makeing code run on each page view

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

is there a way to make a procedure run on every page universally? like for a
security check type thing.. to make sure someone has access to that page,
run a security check method for each page the viewer visits, check to see if
they have access if they do let them see it if not redirect them? thanks
 
There are some paths, and one simpel is use old good inheritance (with code
separation).
In other words u must create class what inherited from System.Web.UI.Page,
define some checks
and then, inherite all other pages in your project from this class instead
of System.Web.UI.Page.

Some over methods is IHttpModules... but it depends on what you want.
 
Brian Henry said:
is there a way to make a procedure run on every page universally? like for a
security check type thing.. to make sure someone has access to that page,
run a security check method for each page the viewer visits, check to see if
they have access if they do let them see it if not redirect them? thanks

You can put the code into global.asax.
 
Thats kind of what I was thinking myself might be possible, but haven't
figured out how to implement it myself yet...
 
ah, thank you.. I really need to start studying web.config and global.asax
soon.... might be a big help :)
 
Back
Top