3
如何以編程方式檢索在ASP .NET中爲Web控件呈現的HTML?如何檢索ASP.NET中控件的呈現html?
比如像:
dim controlHTML as string = myControl.GetHTML()
如何以編程方式檢索在ASP .NET中爲Web控件呈現的HTML?如何檢索ASP.NET中控件的呈現html?
比如像:
dim controlHTML as string = myControl.GetHTML()
System.Text.StringBuilder sb = new System.Text.StringBuilder();
using (System.IO.StringWriter sw = new System.IO.StringWriter(sb))
using (System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(sw))
{
mycontrol.RenderControl(hw);
}
你有實際調用它的.RenderMethod,並通過在HtmlTextWriter的,並從獲得的內容。