使用用户控件,作为一个块,生成一段独立的html。
请求一个一般应用程序,在一般应用程序中加载读取用户控件,并给用户控件传值。
Page page = new Page();
div1 ctl = (div1)page.LoadControl("div1.ascx");
ctl.Id = "1";//给用户控件传递参数
page.Controls.Add(ctl);
StringWriter writer = new StringWriter();
HttpContext.Current.Server.Execute(page, writer, false);
context.Response.Write(writer.ToString());
这样就可以异步请求一个块了。原文:http://www.cnblogs.com/Tpf386/p/7608258.html