1
안녕하세요, 데이터를 내보내기하려고합니다. GridView에서 시트를 엑셀하지만이 오류가 발생했습니다.Excel로 데이터 익스포트 오류
RegisterForEventValidation은 Render() 중에 만 호출 할 수 있습니다.
여기에 내 코드 Web.config 파일에서이 작업을 수행 할 수 있습니다
Dim attachment As String
attachment = "attachment; filename=Contacts.xls"
Response.ClearContent()
Response.AddHeader("content-disposition", attachment)
Response.ContentType = "application/ms-excel"
Dim myStringWriter As New IO.StringWriter
Dim myhtmlStringWriter As New HtmlTextWriter(myStringWriter)
GridView1.RenderControl(myhtmlStringWriter)
Response.Write(myStringWriter.ToString)
Response.End()
감사
어떤 이벤트가 발생 했습니까? – cjk