473,326 Members | 2,168 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,326 software developers and data experts.

Master Page variables

prasans
I have stored some of the variables used by lot of other pages of my website on the master page. As we are migrating to a load balanced environment, I want to know if I need to move those variables to a different place to make them still available even if the requests sent a different web server every time.

Had similar problems when I stored these variables in the session object and had to turn on SQLState to make them available in all web servers.

I am not too sure where the Master page object is stored.

Thanks
Prasanna
Sep 17 '09 #1

✓ answered by Frinavale

I'm not sure how you have got this to work but if you're able to store them in the MasterPage then you should not have a problem with Web Garden or Web Farm environments.

The reason you were having problems with session in this environment is probably because you were probably using InProc Session. This type of Session loads the variables into memory and keeps them there until the Session has expired. The problem with this is that they are loaded into memory on a particular server. If the user's request is sent to another server, then their session is not accessible.

If you still want to use Session you should consider using StateServer Session or SQLServer Session. Both of these types move the Session off of one particular server and into a centralized location so that all servers have access to it.

Check out http://bytes.com/topic/net/insights/...ween-web-pages for more information.

-Frinny

3 3181
Frinavale
9,735 Expert Mod 8TB
I'm not sure how you have got this to work but if you're able to store them in the MasterPage then you should not have a problem with Web Garden or Web Farm environments.

The reason you were having problems with session in this environment is probably because you were probably using InProc Session. This type of Session loads the variables into memory and keeps them there until the Session has expired. The problem with this is that they are loaded into memory on a particular server. If the user's request is sent to another server, then their session is not accessible.

If you still want to use Session you should consider using StateServer Session or SQLServer Session. Both of these types move the Session off of one particular server and into a centralized location so that all servers have access to it.

Check out http://bytes.com/topic/net/insights/...ween-web-pages for more information.

-Frinny
Sep 17 '09 #2
Hi,

I turned on the SQLState and it works fine. (I had to remove the non-serializable items stored in the session though).

About storing the variables in the master page, it was quite simple. I created some variables in the master page and they were available in all the other pages. My guess is, these variables would also be stored in the application server memory and would cause a problem in the clustered environment. Anyways, I moved them to the session as I wasn't sure about the master page content scope.

Thanks
Prasanna
Sep 18 '09 #3
Frinavale
9,735 Expert Mod 8TB
These variables could be stored in the ViewState in the master page. The problem I see with this is making them easily accessible to the content pages.
Sep 18 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Joel Reinford | last post by:
I am attempting to learn how to use Master Pages in ASP.NET 2.0 and am having no success in getting the content page to see the public properties in the master page. I am using code beside and have...
1
by: LilC | last post by:
I'm creating an application that has a standard layout for all pages. The information that is displayed in the layout will be dynamic based on the user that is logged in. Thus when a page is...
2
by: Luigi | last post by:
I'm pretty new in asp.net 2.0 and i'm experiencing this problem: in the master page code i've included some general initialization code common to all content pages, but when i start debugging this...
8
by: savvy | last post by:
I'm developing a shopping cart. I've assigned some Session values to Labels on the Master Page. The Basket panel which is small window for the basket items will be visible on every page if there...
4
by: Sam | last post by:
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...
4
by: Vincenzo Milazzo | last post by:
Hi Is it possible switch between conten page programmatically without lose the control's state in the master page ?
7
by: =?Utf-8?B?TWFyaw==?= | last post by:
keywords: asp.net master page rubbish I have written a custom control. The control is a simple html Tab menu control. The control inherits from DataBoundControl and implements INamingContainer,...
4
by: evantay | last post by:
I'm using ASP.NET 2.0 with VS.NET 2005. I'm trying to access properties from my master pages within a page that inherits from that master page (a child page). However the values are always null....
6
by: mike.gilmore | last post by:
Hi, I'm trying to move all my custom validation code into the master page. Unfortunately anytime I use the response, request, or trace objects in any master page module (other than page_load), ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
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...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.