x将asp.net 控件的呈现html获取,在不少场合会用到,比如生成静态页时
以下代码选自 asp.net 2.0 高级编程
public static string rendercontrolasstring(control ctl)...{
stringwrite sw=new stringwrite();
htmltextwrite write=new htmltextwrite(sw);
ctl.rendercontrol(writer);
string str =sw.tostring();
write.close();
sw.close();
return str;
}
新闻热点
疑难解答
图片精选