Session and View state values are changed: mixed with simultaneous users' session and viewstate values.

I have developed one aspx page(c#) that includes 7pages of the input form: each page is surrounded with panel control. It will be hidden or shown depending on which page the user wants to go. There are several update panels that contain gridview controls on the page. The source of the gridview is session value (arrayList). Whenever the page is postbacked by clicking previous and next buttons to show a certain page and hide other page panels, or adding new list data into the arrayList of the session value ( the value is retrieved on the pertaining gridview), the session and server control values are changed with the data that other users have been entering at around same time. This error occurs before data transaction occurs. 

Could you give me solution not to share the session values with other simultaneous users?

Thanks.

 

0
puket
8/26/2008 8:42:02 PM
asp.net.state-management 8807 articles. 0 followers. Follow

2 Replies
1210 Views

Similar Articles

[PageSpeed] 25

Session & Viewstate values are never shared.It seems to be a problem with your code.Try opening two browsers and see whats happening.

 


Sid heart
0
jsiddharthj
8/26/2008 10:38:45 PM

Hi puket,

Session objects are user dependent, one user’s session objects are not available to other users. However, if the object stored in session is a static object (or Shared object in VB), that object is visable for all the users because actually it is the refrence of that object stored in each users’ session and only one instance of that object exists.

Hence, please don’t store static (Shared) object in session.

 


Sincerely,
Benson Yu
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
0
Benson
9/1/2008 11:29:32 AM
Reply:

Similar Artilces:

Session values are mixed other users Session
Hi all,  In my webapplication, when a user logins I am storing Username in Session Variable, and all user access is based on username stored in the Session. But now I am facing a problem, I am getting other users access, If I print session Variable then I am getiing other  userId only. its urgent                    Please reply.................................     Post your code here. Definately you made some mistake in code else such wierd stuff wont happen.Robin Kedi...

Unable to serialize the session state. Please note that non-serializable objects or MarshalByRef objects are not permitted when session state mode is 'StateServer' or 'SQLServer'
 Hi,We are trying to implement Network loading for our asp.net (1.1) application for which we are storing the session in State Server.Following is the error is thrown while page is rendered when ever is a DTO is stored in to SEssion in any of the page.Unable to serialize the session state. Please note that non-serializable objects or MarshalByRef objects are not permitted when session state mode is 'StateServer' or 'SQLServer' Following the code I written for DTO (C# Asp.net 1.1).     using System;    using System.Runtime.Serializa...

Session State and View State
Hi Everyone, Can anybody tellme how are these used in context with ASP.NeT whats their sole purpose?.....and where in programming we use  them? Any links or sources would be good which explains in simple terms.   thanks Simi  ThanksSimi------------&------------"To learn to succeed, you must first learn to fail." -Michael Jordan Here is one of the discussion http://forums.asp.net/t/1145838.aspxMPI never desire to converse with a man who has written more than he hasread. -Samuel Johnson, lexicographer (1709-1784)  Hi There is a video tutorial a...

Usage scenarios for view state, session state, application state, cookies
Hi Guys, Im a college student in London with exams starting Monday on ASP.NET with C#.  Id be so grateful if you could provide me with solid real world scenarios/examples of when you would use the following to maintain state and why you would use them in that instance:   View State Session State Application State Cookies Also when would you use SOAP instead of the REST architecture and vice versa and why - again real world usage scenarios?  I note Amazon's web service uses the REST architecture - why is this, why dont they use SOAP. Id be grateful for a timely respon...

storing values
Hi Friends: I am developing an online survey application using ASP.Net and SQL server. There are about 80 questions spread over 20 pages (department would like to have only 4questions/ page). I am trying to find out: 1. How to measure the adverse effect on performance of application if I use Session objects.. 80 responses and 50-100 users logged in at a time. Will my web-server be able to handle it? 2. What other options such as cookies/ hidden variables/ URL query-string are feasible in this scenario? How to assess their respective performances? I would appreciate any help on th...

session value not working, but hard coding value works, but session value writes to label correctly
I add a value to the session in the parent window:Session("value1") = value.text.trim()I have a button on a that page opening a popup window using javascript.In the popup window I get the value from the session:Protected Sub Page_Load......Dim ValueDesc As String = Session.Item("value1") Label1.Text = ValueDesc (This shows the correct value for ValueDesc)I then get the first 3 char of ValueDescDim SearchString As String = Left(ValueDesc, 3) Label2.Text = SearchString (This shows the correct value for SearchString)I then pass SearchString to a Protected Sub:BindtoGrid(Sear...

How to change the value of one item of the session state from a web service ?
Hi,I tried changing the value of one item of the session state from a web service, but unfortunately it doesn't work at all.The value remains the same whereas I changed it.I would share an information between the web service and the page. When the web service has been terminated, I have a script which raises a  server-side event, and in this event I would like to retrieve the value that I changed in the web service.Is it possible to share information fromp the web service to the page, or is it possible only from the page to the web service. In the last way, it works correctly. ...

Serious problem with Session variable, (session is mixing with other user's session)
Hi All I am facing a serious problem with session values. I have a webbased Hospital Management software in ASP. Around 200 users are using this at the same time. In this application when a user logins, I am saving the UserName in a session Variable, and all user access is based on the username in the session variable. (eg. session("userid")="myusername"). This was woking perfectly since last 4 years. Now the problem is, when a user logins, he is getting other users access who logined in the software. If I print the sesion username I am getting another username only...

session state faster than view state??
Hello, I have been told not to use session state because we will potentially have a server farm. However, my web page runs MUCH slower with view state than session state. In debug, it takes 60-90 seconds before I even hit the breakpoint on the page load event. It is also considerably slower out of debug. I need to potentially save a large dataset of information. Is this difference expected or is there something wrong with my project. If its my project, can you give me some ideas of where to look for problems? Thanks in advance. Session state stays on the server, wehreas ViewSta...

Can't save the value in HttpContext.Current.Session state
Hello,I have a class file (class1.cs) and I'm trying to put the variable in the HttpContext.Current.Session so I can access it in another class file (class2.cs) but get an error: "Object reference not set to an instance of an object".  Does anyone knows why and how do I solve it?  Thanks in advance. class1.cs HttpContext.Current.Session.Add("ReportName", ReportName);    //Error: Object reference not set to an instance of an object.   It seems that the Httpcontext is not avalible from where you are trying to access it. ...

The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increas
Hi.. I am making a mobile application using .net framework 2.0. My Application has  web farm scenario so for state management  I am using Sateserver in my application. My application runs fine if I dont use web farm scenario But in case of web farm scenario it is giving me error "The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increasing the history size or session expiry limit."   &...

"The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increa
Hi.. I am making a mobile application using .net framework 2.0. My Application has web farm scenario so for state management I am using Sateserver in my application. My application runs fine if I dont use web farm scenario But in case of web farm scenario it is giving me error "The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increasing the history size or session expiry limit." I am not getting why this error is coming ..Though I already h...

- is sessionstate mode of web config only for session variables or is it also for application and view state values
-         is sessionstate mode of web config only for session variables or is it also for application and view state valuesThanks a lot, I appreciate your taking the time to help me. Session State mode in web.config applies only to to Session. ViewState is in the page and Application is part of the AppDomain. So, no it is not for application and viewstate.Cheers,       Kevin JonesMy Blog...

On refresh the hidden field or View State user key value changes. How can I avoid that?
I am working on this project...where I am supposed to submit some form values to database. In Page_Load event I initialize a user key by getting a sequence number from database. The bad part is the sequence number i.e; user key changes on refresh. Basically, I am trying to save the user key in a hidden field or view state so that in case of duplicate submission I catch it. here is my code. Whats the best way to handle this?if (!IsPostBack) { if (ViewState["UserKey"] == null) ViewState["UserKey"] = GetNewUserKey(); }       if you need to do it ...

Web resources about - Session and View state values are changed: mixed with simultaneous users' session and viewstate values. - asp.net.state-management

Simultaneous game - Wikipedia, the free encyclopedia
Rock-Paper-Scissors, a widely played hand game, is a real life example of a simultaneous game. Both make a decision at the same time, randomly, ...

Mera - productivity email app for simultaneous inbox management on the App Store
Read reviews, compare customer ratings, see screenshots, and learn more about Mera - productivity email app for simultaneous inbox management. ...

iPad supports 11 simultaneous touches - YouTube
I wanted to check how many simultaneous touches the iPad's screen supported, so I wrote some code to test it. Turns out that it supports eleven ...

Summernats to attempt world record 100-car simultaneous burnout
Engines are revving across the ACT as Canberra car lovers get ready to descend on Exhibition Park.

Two Sydney convenience stores targeted in simultaneous robberies
Masked robbers targeted two family-run convenience stores on opposite sides of a street in the Sydney's inner west on Friday night, in what police ...

Charlie Hebdo suspects killed as police launch simultaneous assaults at hostage stand-offs: reports
Police hunting for two brothers suspected of the Charlie Hebdo killings have descended on a town north-east of Paris.

Good news: Chrome may soon get simultaneous multilingual spellchecking
Do you speak and write in more than one language – and often use them interchangeably? If so, you may know the frustration of having to constantly ...

Sprint and Verizon won’t support simultaneous voice and data on iPhone 5
... the the carrier’s lineup of LTE Android smartphones, we have been able to confirm with Verizon that the new iPhone 5 will not support simultaneous ...

TV Plus IPad: Simultaneous Use Enhances Engagement for Many
Nearly half the people using digital devices while watching TV say they're more likely to search for a product they see advertised on the TV, ...

Simultaneous Viewing and Surfing Commonplace
... according to a new study conducted by Nielsen on behalf of Yahoo, which found that three out of four Americans use the Web and TV simultaneously, ...

Resources last updated: 2/4/2016 12:51:22 PM