473,398 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Session attributes lost after postback

i separate my application into business layer and presentation layer.
After a user logged in, i fetched his/her user information and store
them in session object. And then the first page is loaded for the first
time, i can get the session variable from the session object.
but when i click a button on the aspx page, the page get postback and
the page_load method gets reloaded, this time, i can't get the session
variables though the session object remains the same. It's quite
weired.
It's quite critical for my application, i 'd like to know what's the
problem. Anyone giving the tips?

Thanks!

Nov 9 '06 #1
1 5371
Two and only two issues can cause your problem. You are either clearing the
session somewhere in code, or you application pool is being recycled causing
you to lose you session information. It's not that difficult to isolate the
culprit. One involves examining your code, the other involves examining the
eventvwr for application recycle messages.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
"harryaya" <bo*********@gmail.comwrote in message
news:11*********************@k70g2000cwa.googlegro ups.com...
>i separate my application into business layer and presentation layer.
After a user logged in, i fetched his/her user information and store
them in session object. And then the first page is loaded for the first
time, i can get the session variable from the session object.
but when i click a button on the aspx page, the page get postback and
the page_load method gets reloaded, this time, i can't get the session
variables though the session object remains the same. It's quite
weired.
It's quite critical for my application, i 'd like to know what's the
problem. Anyone giving the tips?

Thanks!

Nov 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Paul | last post by:
Hi I've almost finished the web page I'm developing (with a great deal of help from this group - thanks everyone). My page contains 3 drop down boxes, a SEARCH button, a datagrid (populated...
0
by: mtcc | last post by:
i try simple web page, for first time i add session "aa" var, and i add button, and i check if session keep aa value in postback. when i add call to Dataadapter.fill method, i lost my session on...
9
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of...
2
by: Tomas Martinez | last post by:
Hi, Well, my problem is so simple as it says in the subjet but very frustrating also. I have a project and it is losing the session variables with each postback, so I downloaded from the web a...
2
by: Ivers | last post by:
My C# asp.net app (.NET 1.1) can generate an email whose body contains a link to the current page of the app. When the recipient of the email clicks the link (usually from Outlook), the app...
5
by: rockdale | last post by:
Hi, all: I have a linkbutton and I use javascript to open another webpage in a new window. I also want to set my session variable value when this linkbutton get clicked. These session variable...
1
by: LG | last post by:
I want to add attributes to a custom dropdownlist and I found some code on Internet that doesn't work after post back. First time the control has the attributes, but after postback the attributes...
6
by: Ken Varn | last post by:
When I am running my ASP.NET 2.0 application using VS.NET 2005 ASP.NET Development Server, the session state seems to be getting lost at various times without warning. I am not sure why this is...
1
by: =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ== | last post by:
I have an application in which I store state in the Session object. There are two paths of execution in the Page_Load method of the default page. In one path the Session state is preserved across...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.