第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何導出到Excel?

如何導出到Excel?

ITMISS 2019-10-22 21:14:02
我遵循了本指南,該指南是另一篇關(guān)于此指南的建議,但我無法完全使它起作用。我嘗試重定向到/ LogModelsController / ExportData時收到404錯誤,據(jù)我所知,這正是我應該做的。_LogPartialLayout.cshtml@using (Html.BeginForm("ExportData", "LogModelsController", FormMethod.Post, new { enctype = "multipart/form-data" })){    <table class="table">        <tr>            <th>                @Html.ActionLink("message", "Index", new { sortOrder = ViewBag.NameSortParm, currentFilter = ViewBag.CurrentFilter })            </th>            <th>                @Html.ActionLink("timestamp", "Index", new { sortOrder = ViewBag.NameSortParm, currentFilter = ViewBag.CurrentFilter })            </th>            <th>                @Html.ActionLink("level", "Index", new { sortOrder = ViewBag.NameSortParm, currentFilter = ViewBag.CurrentFilter })            </th>        </tr>        @foreach (var item in Model)        {            <tr>                <td>                    @Html.DisplayFor(modelItem => item.message)                </td>                <td>                    @Html.DisplayFor(modelItem => item.timeStamp)                </td>                <td>                    @Html.DisplayFor(modelItem => item.level)                </td>            </tr>        }    </table>    <input type="submit" name="Export" id="Export" value="Export" />}LogModelsController.cspublic ActionResult ExportData()        {            GridView gv = new GridView();            gv.DataSource = db.Log.ToList();            gv.DataBind();            Response.ClearContent();            Response.Buffer = true;            Response.AddHeader("content-disposition", "attachment; filename=Loglist.xls");            Response.ContentType = "application/ms-excel";            Response.Charset = "";            StringWriter sw = new StringWriter();            HtmlTextWriter htw = new HtmlTextWriter(sw);            gv.RenderControl(htw);            Response.Output.Write(sw.ToString());            Response.Flush();TD; DR:如何正確將此表導出到Excel?獎勵:它也可以與PagedList一起使用嗎?
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 458 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號