i made a folder in visual studio 2010 (my folder) and i have many pages inside that folder base on master and content pages…
i want to hook a class to every Page_Load Or Page_PreInit of every content pages inside that folder except master page!
how can i do that with private web.config inside that folder?
thanks in advance
I am not sure that something like that is possible the way you need it but here are some thoughts.
Initially you must create a class that inherits from
System.Web.UI.PageandoverrideOnLoadorOnPreInit. Something like that:Next, you can:
Either Use the
pageBaseType="typename, assembly"attribute inside<system.web/pages>. But this works only for pages that don’t have a code-behind file so you need to delete it and also remove theInheritsattribute at the top of the aspx (Mark-Up) page.Or edit the code-behind file of the pages you want to use your custom class and make them inherit from that.