Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > HttpContext.Current.Session problem

Reply
Thread Tools

HttpContext.Current.Session problem

 
 
Julia
Guest
Posts: n/a
 
      06-21-2006
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
 
Reply With Quote
 
 
 
 
Alessandro Zifiglio
Guest
Posts: n/a
 
      06-23-2006
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" <> ha scritto nel messaggio
newsFD2AFA6-8D77-46DC-B75D-...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57