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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何導(dǎo)出到Excel?

如何導(dǎo)出到Excel?

ITMISS 2019-10-22 21:14:02
我遵循了本指南,該指南是另一篇關(guān)于此指南的建議,但我無法完全使它起作用。我嘗試重定向到/ LogModelsController / ExportData時(shí)收到404錯(cuò)誤,據(jù)我所知,這正是我應(yīng)該做的。_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:如何正確將此表導(dǎo)出到Excel?獎(jiǎng)勵(lì):它也可以與PagedList一起使用嗎?
查看完整描述

3 回答

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

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

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