Protected Sub btn_export_to_excel_Click(sender As Object, e As EventArgs)
StrExport.Append("")
StrExport.Append("")
StrExport.Append("
")
StrExport.Append(dvData.InnerHtml) //ERROR WHILE GETTING DIV ID
StrExport.Append("
") Dim strFile As String = "StudentInformations_CODESCRATCHER.xls"
Dim strcontentType As String = "application/excel"
Response.ClearContent()
Response.ClearHeaders()
Response.BufferOutput = True
Response.ContentType = strcontentType
Response.AddHeader("Content-Disposition", Convert.ToString("attachment; filename=") & strFile)
Response.Write(StrExport.ToString())
Response.Flush()
Response.Close()
Response.[End]()
End Sub
Vincent Maverick DuranoPosted Apr 11, 2016, 7:24 AM
Vincent Maverick DuranoPosted Apr 11, 2016, 7:22 AM