I want to bind to the Page PreRender method on at the global.asax level, but for some reason the method is never getting called. My method looks like:
protected void Page_PreRender(object source, EventArgs e)
{
/* do stuff */
}
Am I able to call Page events like this in Global.asax?
The global.asax is derived from HttpApplication class and not contain the Page_PreRender event as you can see on the MSDN reference:
http://msdn.microsoft.com/en-us/library/system.web.httpapplication(VS.90).aspx
If you want to globally capture the PreRender event you can make a different base class for the
System.Web.UI.Page, overwrite this event, and use this class to your pages.For example
and use the
BasePageon your pages