Run method only on first load?

D

DKode

Here is my scenario:

I have two methods that I only wish to have run the very first time a
user hits the default.aspx page. This page is protected with Forms
protection. default.aspx is the base page for the entire app which
will probably end up being 100 different tools/modules.

The first time the user opens the app, i want to set an Admin object
and load it with their information and save it to the session, then i
have a dropdown dhtml menu that I construct from XML depending on
their permission level. Once this is constructed the first time, i
want to save the javascript used to generate it into the session so on
subsequent hits, the app doesn't have to parse the same xml file over
and over again when it is always going to be the same user until they
log out and log back in.

I thought of doing it in a:
IF NOT (IsPostBack)
routine, but this routine will run more than just the first time the
default.aspx page loads.

How would I accomplish this? I am fairly new to ASP.net and am still
learning the ins and outs.

Thank you for your help!

DKode
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top