ValentinBadea
New member
Hello !
How can I export gridView to Excel ? Im using ASP.NET 1.1 code:
that works with 1.1 but here (2.0) this code rise error:
"Control ctl00_Main_gvw of type GridView must be placed inside a form tag with runat=server."
Any idea ?
How can I export gridView to Excel ? Im using ASP.NET 1.1 code:
Code:
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
gvw.RenderControl(hw)
Response.Write(tw.ToString)
Response.End()
"Control ctl00_Main_gvw of type GridView must be placed inside a form tag with runat=server."
Any idea ?