Monday, March 26, 2012

Panel inner HTML

Hi all,

Is there a way to grab all the HTML that is contained inside a panel control? If so, how?

Cheers,
Davidyes, it should look to something like...

System.IO.TextWriter tw = new System.IO.TextWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
Panel1.RenderControl(hw);
string html = hw.ToString();
Of course, the results will depend on the things that you put inside ur panel... so be sure you know what're doing...
Hi ccalderon,

That is exactly what I was looking for, thanks! I did need to trim out some unneeded HTML, but all is good... :D

Cheers,
David

0 comments:

Post a Comment