makeing code run on each page view

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
 
D

Dmitry Andreev

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.
 
J

John Saunders

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.
 
B

Brian Henry

Thats kind of what I was thinking myself might be possible, but haven't
figured out how to implement it myself yet...
 
B

Brian Henry

ah, thank you.. I really need to start studying web.config and global.asax
soon.... might be a big help :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top