HttpModule - get HTML content or controls for modifications

前端 未结 4 850
长情又很酷
长情又很酷 2021-01-03 09:02

Tried something like this:

HttpApplication app = s as HttpApplication; //s is sender of the OnBeginRequest event
System.Web.UI.Page p = (System.Web.UI.Page)a         


        
4条回答
  •  遥遥无期
    2021-01-03 09:08

    I'm not sure, but I don't think you can use an HttpModule to alter the Page's control tree (please correct me if I'm wrong). You CAN modify the HTML markup however, you'll have to write a "response filter" for this. For an example, see http://aspnetresources.com/articles/HttpFilters.aspx, or google for "httpmodule response filter".

提交回复
热议问题