M
Madison
Hello,
I try to export to Excel from gridview using framework2 with master page.
Here is my coding
Response.Clear()
Response.AddHeader("content-disposition",
"attachment;filename=foe.xls")
Response.ContentType = "application/vnd.xls"
Response.Charset = ""
Me.EnableViewState = False
Dim sw As New System.IO.StringWriter
Dim htmlWriter As New HtmlTextWriter(sw)
myGrid.RenderControl(htmlWriter)
Response.Write(htmlWriter.ToString)
Response.End()
When I ran it, I got the message said "Control 'ctl00_BodyContent_myGrid' of
type 'GridView' must be placed inside a form tag with runat=server". I have
tried many search but nothing it works yet.
Any solution to this message.
Thanks.
I try to export to Excel from gridview using framework2 with master page.
Here is my coding
Response.Clear()
Response.AddHeader("content-disposition",
"attachment;filename=foe.xls")
Response.ContentType = "application/vnd.xls"
Response.Charset = ""
Me.EnableViewState = False
Dim sw As New System.IO.StringWriter
Dim htmlWriter As New HtmlTextWriter(sw)
myGrid.RenderControl(htmlWriter)
Response.Write(htmlWriter.ToString)
Response.End()
When I ran it, I got the message said "Control 'ctl00_BodyContent_myGrid' of
type 'GridView' must be placed inside a form tag with runat=server". I have
tried many search but nothing it works yet.
Any solution to this message.
Thanks.