0

There is a gridview which includes some data.

The header style of that gridview is

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

How can I export that gridview to excel? I want to export what I see, colour, filter etc.

when I follow this link gridview to excel

I get error because it says there there should be form tag which includes runat="server" but when I add it, it gives again error because masterpage has already have a form..

4

1 回答 1

1

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

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

这将解决您的问题。

于 2012-09-01T07:02:32.383 回答