I have a pretty basic vb.net page that has textbox control on it and a "generate" button that when clicked, fills a datagrid. That all works great, but when the user clicks the "Export to Excel" button, I get this error.. RegisterForEventValidation can only be called during Render();
Here's my code behind, I thought I included everything I needed...
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
Private Sub ExportToExcel(ByVal strFileName As String, ByVal dg As GridView)
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("content-disposition", "attachment;filename=" & strFileName)
Response.Charset = ""
Me.EnableViewState = False
Dim StringWriter As New System.IO.StringWriter()
Dim HtmlTextWriter As New System.Web.UI.HtmlTextWriter(Str
View Complete Post