473,320 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Maintaining State on Master Page Without Session Variables

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
4 4296
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: leegold2 | last post by:
Probably a newbie question about "state": My problem is I have a search form, so user enters a keyword <enter>, then this form posts to another page were the result are displayed. But this...
9
by: Greg Linwood | last post by:
I'm having difficulty understanding Session state in ASP.Net. It's almost embarrassing asking this as I've been using ASP since it was first released & it really shouldn't be this hard to use -...
5
by: Arun | last post by:
Hi, Is it possible to share Session/Application State across different Asp.net webapplication (one in VB.net ) and the other is C# ? If so can you guide me ? -Regards' Arun
2
by: Chris | last post by:
Hi, I am building a single webform/webpage asp.net application using VB.NET. I have created lots of classes for this web application. On page load I use a facade controller pattern class to...
10
by: tshad | last post by:
I have been using the default session state (InProc) and have found that I have been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much...
9
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of...
1
by: clintonG | last post by:
I'm having a problem maintaining state with a Panel control in a MasterPage and I need help thinking through this process. The basic structure of the HTML in the Master looks like this... ...
9
by: cashdeskmac | last post by:
I have put a string into Session and tried to retrieve it on the next page I visit but the Session appears empty. I have exactly the same spelling for both adding and retrieving the value: ...
1
by: Owen Richardson | last post by:
I have an asp.net website where i have a quick search facility built into my master page. the search is a web control, with a drop down country box and a list box full of cities. When i select...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.