Posted on: 10/14/2014 11:32:07 AM | Views : 409

I my application i need the html version of a asp page  So I began to convert the asp to the html by using the below snippet
Public Function GetInnerHtml() Dim allTextBoxValues As String = "" Dim c As Control Dim childc As Control For Each c In Page.Controls For Each childc In c.Controls allTextBoxValues &= RenderControlToHtml(childc) Next Next Return allTextBoxValues End Function Public Function RenderControlToHtml(ByVal ControlToRender As Control) As String Try Dim sb As New System.Text.StringBuilder() Dim stWriter As New System.IO.StringWriter(sb) Dim htmlWriter As New System.Web.UI.HtmlTextWriter(stWriter) ControlToRender.RenderControl(htmlWriter) Return sb.ToString() Catch ex As Exception End Try ...

Go to the complete details ...