pooja nirmalkar

pooja nirmalkar

  • NA
  • 22
  • 7.6k

unable to get div id from asp.net to vb.net code

Apr 11 2016 2:27 AM
Protected Sub btn_export_to_excel_Click(sender As Object, e As EventArgs)
StrExport.Append("<html xmlns='http://www.w3.org/1999/xhtml'>")
StrExport.Append("<body class='hold-transition skin-blue sidebar-mini'>")
StrExport.Append("<div class='box-body' id='dvData'>")
StrExport.Append(dvData.InnerHtml)      //ERROR WHILE GETTING DIV ID
StrExport.Append("</div></body></html>")
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

Answers (2)