Hi
i have a datagrid with a button column,button type is Linkbutton
and i'm exporting the datagrid to Excel by the following code
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Response.AppendHeader("ContentType", "application/octet-stream")
Response.AppendHeader("Content-Disposition", "attachment; filename=" & "abc.xls" & "")
dgOrderRate.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
but it is giving an error like this
'DataGridLinkButton' must be placed inside a form tag with runat=server.
please help me out
i want export the grid as it is disaplaying on the webform
if i remove the linkbutton it is working fine
and the sme problem persists if i set the allowsorting=true
i have a datagrid with a button column,button type is Linkbutton
and i'm exporting the datagrid to Excel by the following code
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Response.AppendHeader("ContentType", "application/octet-stream")
Response.AppendHeader("Content-Disposition", "attachment; filename=" & "abc.xls" & "")
dgOrderRate.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
but it is giving an error like this
'DataGridLinkButton' must be placed inside a form tag with runat=server.
please help me out
i want export the grid as it is disaplaying on the webform
if i remove the linkbutton it is working fine
and the sme problem persists if i set the allowsorting=true