Maintaining State on Master Page Without Session Variables

S

Sam

I have an asp.net 2.0 app that uses a sitemap, Master Page, and has
several content pages. While this feature has simplified the process of
creating a data-driven site menu, it does seem to have some big
restrictions.

Namely, maintaining state on the Master Page across all content pages.
I simply want to keep track of a key value across all content pages.
The only solution I can come up with is using a session variable, which
I hate.

Can't use ViewState because it preserves state across postbacks, and
when navigating through the menu we're not posting back but navigating
to a new page. Querystrings are not an option because the site
navigator uses the url defined in the site map to navigate to the next
page without providing an opportunity to inject querystrings.

Anyone come up with good way of handling this?

Thanks ...
 
S

Sam

Maybe you could store it in a cookie, or an anonymous profile variable?

I considered using a cookie, but they've always had such a bad
reputation ...

What's an "anonymous profile variable"?

Thanks for the reply ...
 
G

Guest

Sam,
Why do you hate Session variables?
If it is something site-wide, and not really user-specific like Session,
try storing it either in Applcation state, or in Cache.
Or, you could store whatever structure or other item in a static Hashtable
or other Collection object in Global.asax.
Peter
 
S

Sam

Sam,
Why do you hate Session variables?

I'm expecting this application to grow in volume and want to add
additional servers and a content switch. would like to leave the
sticky setting off on our cisco routers. We've not yet made use of the
features involving persisting session variables in SQL Server or
otherwise.

Thanks for the recommendations - they sound promising.

Sam
 

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,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top