我想在母版页的 LoadComplete 事件中捕获 asp.net 页面的 HTML 输出。这就是我所拥有的:
public partial class MasterPage_MyBlogMainMaster : System.Web.UI.MasterPage
{
protected void Page_LoadComplete(object sender, EventArgs e)
{
var PageURL = HttpContext.Current.Request.Url.AbsolutePath;
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter hWriter = new HtmlTextWriter(sw);
base.Render(hWriter);
string PageResult = sb.ToString();
}
}
问题是事件似乎没有触发。我需要改变什么?
谢谢。