首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

页面回调时panel里面的控件怎么通过htmltextwrite方法给转换成html字符串?40分

2011-12-24 
页面回调时panel里面的控件如何通过htmltextwrite方法给转换成html字符串?急40分这个同样的问题,2帖子一起

页面回调时panel里面的控件如何通过htmltextwrite方法给转换成html字符串?急40分
这个同样的问题,2帖子一起给分
http://community.csdn.net/Expert/topic/5415/5415247.xml?temp=.0381586


<asp:Panel   ID= "Panel1 "   runat= "server "   Height= "100% "   Width= "100% ">
                        <table>
                                <tr>
                                        <td>
                        <asp:LabelID= "Label1 "runat= "server "Text= "Label "> </asp:Label>
                                        </td>
                                </tr>
                        </table>
</asp:Panel>  

这段。

StringWriter   sw   =   new   StringWriter();
HtmlTextWriter   hw   =   new   HtmlTextWriter(sw);
Panel1.RenderControl(hw);

后面怎么把label1写出来?

谢谢大家

[解决办法]
不明白楼主想要做什么,如果想通过后台cs页面输出html代码

直接把内容 render出来 就可以了

热点排行