I have a strange problem:
I have a site which has an administration system.
In the system there is a way to edit my inputs. To make this easier, I can search for their ids to find them.
The problem is when the page posts back the session variable I hold the “logged in” value in, becomes nothing.. and i get kicked out. Why is that happening? Session variables should hold at least 20 minutes if anything else is stated?
EDIT: It works for a coworker, but not for me.. Also, it only does it on certain inputs.
EDIT2: Turns out i get an exception. but it doesnt say what, only says “property evaluation failed”. i get it on this code row:
Response.Redirect("./admin.aspx?search=" + u.FirstOrDefault.ProductID.ToString, False)
And sience it goes through this statement, its not because it is an objectreference not set to an instance of an object
If u.Any Then
If you experience an exception your session might be restarted.
Create a global.asax and set breakpoints to the Application_Error, Session_End and Session_Start events to track down the issue
Edit based on your update:
Make sure that u.Count == 1, because FirstOrDefault will throw an exception, if the count is > 1.
Have a look at this link http://support.microsoft.com/kb/312629/EN-US/ which should cover your original problem
http://forums.asp.net/t/1296202.aspx/1