Site-wide page load event

I have something that should be run at every page_load event in an aspx application, how would I go about doing this, I've looked in the asax file but I can't find what I want...

I specifically want to hook up some javascript code depending on the user...

Upvotes: 0

Views: 81

Answers (2)

MattN
MattN

Reputation: 198

You could create a base class that inherits from System.Web.UI.Page (you will put your javascript in that base class)

Then in each of your aspx pages, simply have the page derive from your base class.

Upvotes: 1

Fishcake
Fishcake

Reputation: 10754

You could use a MasterPage and have every page in your site inherit that MasterPage. Be aware of the order of events in Master/Content pages

Upvotes: 1

Related Questions