get HTML code of table created dynamically ????

  • Thread starter Thread starter Rosau
  • Start date Start date
R

Rosau

I create a table dynamically using VB, How do I get HTML code for
that table into a string variable ??? any sugestion, Thanks
 
I create a table dynamically using VB, How do I get HTML code for
that table into a string variable ??? any sugestion, Thanks

You can use the RenderControl method and send it to an HtmlTextWriter
(which can be initialized to write to a StringWriter).
 
Could you please give me an example... how to use this RenderControl
Method and HtmlTextWriter, Thanks !!!
 
Dim sb As New System.Text.StringBuilder()
Dim sw As New StringWriter(sb)
Dim hw As New Web.UI.HtmlTextWriter(sw)

ptable.RenderControl(hw)

and then sb.ToString()




Rosau said:
Could you please give me an example... how to use this RenderControl
Method and HtmlTextWriter, Thanks !!!
 
Thanks a lot! it is working perfect!!!
pb said:
Dim sb As New System.Text.StringBuilder()
Dim sw As New StringWriter(sb)
Dim hw As New Web.UI.HtmlTextWriter(sw)

ptable.RenderControl(hw)

and then sb.ToString()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top