Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   HttpContext.Current.Session problem (http://www.velocityreviews.com/forums/t778396-httpcontext-current-session-problem.html)

Julia 06-21-2006 12:39 PM

HttpContext.Current.Session problem
 
Hi

I have developed a custom control. I want to keep a dataset in the:
HttpContext.Current.Session.Add("test", dsProducts);

If I open a browser and then open a new one using Ctrl+n I get problem. I
think the browsers share the same HttpContext.Current.Session so if I change
the dataset in one browser and then want to use the dataset in the other
browser the I get the edited dataset. How can I keep values separeted in two
browsers?

Thanks
Julia

Alessandro Zifiglio 06-23-2006 06:41 AM

Re: HttpContext.Current.Session problem
 
hi Julia, IMHO, storing a dataset in session is generally not a very good
idea. A session is user specific, so for each user that visits your site you
store a dataset in memory, for the duration of that user session(till the
session timesout), seems to be a waste of resources for you + producing
unwanted behavior as you described. If you need to store that information
for the current page only, you can try and store it in viewstate Versus
storing it in session. Viewstate gets stored in the current page and will
persist across postbacks but not across pages or for the duration of the
user session. The disadvantage might be a heavy page served to the client,
so as you can see there are some tradeoff's.
But you will get the behaviour that you are looking for, that is, it will be
page specific, change made in one page wont effect that other =P

have a good day,
Alessandro Zifiglio
"Julia" <Julia@discussions.microsoft.com> ha scritto nel messaggio
news:DFD2AFA6-8D77-46DC-B75D-4FCB5E742020@microsoft.com...
> Hi
>
> I have developed a custom control. I want to keep a dataset in the:
> HttpContext.Current.Session.Add("test", dsProducts);
>
> If I open a browser and then open a new one using Ctrl+n I get problem. I
> think the browsers share the same HttpContext.Current.Session so if I
> change
> the dataset in one browser and then want to use the dataset in the other
> browser the I get the edited dataset. How can I keep values separeted in
> two
> browsers?
>
> Thanks
> Julia





All times are GMT. The time now is 09:55 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.