参考事实证明Ajax的世界更需要ASP.NET MVC中的代码:
Page page = new Page(); Control control = page.LoadControl("~/Controls/MsgListControl.ascx"); st); StringBuilder sb = new StringBuilder(); using (StringWriter sw = new StringWriter(sb)) { using (HtmlTextWriter htw = new HtmlTextWriter(sw)) { control.RenderControl(htw); return sb.ToString(); } }
谢谢dudu,问题解决了。