|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
HttpContext.Current.Session problemHi
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 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 Show quoteHide quote "Julia" <Ju***@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
Problem updating with TableAdapter in Detailsview.
Gridview right border on a per-column basis Validators - error message not showing when JS disabled & only server side validation occurs "AJAX" techniques for the ASPNET 2.0 TreeView control? aspx and ascx ASP.NET 2.0 Intrinsic Treeview control errors on a specific machine I need a chart control with a special feature Sorting DataView problem Interactivity between placeholders & objectdatasouces .Net 2.0 Web UserControl EditorAttribute Problem |
|||||||||||||||||||||||