开发者

How to get HTML code of a .NET control

开发者 https://www.devze.com 2023-01-07 11:46 出处:网络
I have a .net panel, and I want to send this panel via outlook to other recipients. For this I think I have to find 开发者_如何学Cthe html code of this element. How to do that ?

I have a .net panel, and I want to send this panel via outlook to other recipients. For this I think I have to find 开发者_如何学Cthe html code of this element. How to do that ?

Thanks.


Use the RenderControl method to output the contents to an HtmlTextWriter.

Example, which outputs the content to a StringBuilder.

StringBuilder content = new StringBuilder();
StringWriter sWriter = new StringWriter(content);
HtmlTextWriter htmlWriter = new HtmlTextWriter(sWriter);
pnlMyPanel.RenderControl( htmlWriter );
0

精彩评论

暂无评论...
验证码 换一张
取 消