By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,717 Members | 2,052 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,717 IT Pros & Developers. It's quick & easy.

Maintaining State on Master Page Without Session Variables

P: n/a
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 ...

Oct 6 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Maybe you could store it in a cookie, or an anonymous profile variable?

Sam wrote:
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 ...
Oct 6 '06 #2

P: n/a
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 ...

Oct 6 '06 #3

P: n/a
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

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Sam" wrote:
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 ...

Oct 7 '06 #4

P: n/a
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
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

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Sam" wrote:
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 ...
Oct 7 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.