I have developed a web application which contains 50 pages & now i want to call a method on each page_load.So,Is there any way i can attach my method to existing class Event. So whenever that event gets raised my method will be called.
example : Can i attach mymethd() to page_load event of page class so whenever any page will load my mymethod() will be called. I dont want to inherit the page class.
did you build your website with “Master” pages? and derived each of your pages from the master? That would definitely make it easier…
Then, add the method to the outer “Master” page and during ITs load event, auto instantiate the call to your “event”.