【问题标题】:From gridview to excel export - How can I get excel what I see in the application?从 gridview 到 excel 导出 - 如何获得我在应用程序中看到的 excel?
【发布时间】:2012-07-12 08:49:49
【问题描述】:

有一个包含一些数据的gridview。

那个gridview的标题样式是

<HeaderStyle BackColor="#006699" CssClass="GridViewHeader" Font-Bold="True" ForeColor="White" />

如何将 gridview 导出到 Excel? 我想导出我看到的内容、颜色、滤镜等。

当我点击此链接时 gridview to excel

我收到错误,因为它说应该有包含 runat="server" 的表单标签,但是当我添加它时,它再次给出错误,因为 masterpage 已经有一个表单..

【问题讨论】:

    标签: c# gridview


    【解决方案1】:

    将此代码复制并粘贴到您的页面中:

    public override void VerifyRenderingInServerForm(Control control)
    {
        /* Confirms that an HtmlForm control is rendered for the specified ASP.NET
           server control at run time. */
    }
    

    这将解决您的问题。

    【讨论】:

      猜你喜欢
      • 2010-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-19
      • 2023-03-17
      • 2013-09-25
      相关资源
      最近更新 更多