ascx 转换成 html
我自己定义了一个helo.ascx 的服务器控件,想把他转换为 html
代码如下
StringWriter sw = new StringWriter();
Page page = new Page();
Control ctl = page.LoadControl("/helo.ascx");
page.Controls.Add(ctl);
Server.Execute(page, sw, false);
Response.Write(sw.ToString());
这个虽然 能转。。。但要在 helo.ascx 页面上服务器form控件。。。有什么方法不要加吗