简体   繁体   中英

Problem with the session in the asp.net

I'm new to the asp.net. I'm developing one web site which is having diffenent web pages &

I've created 3 web pages in all web pages i set the one session variable & depending on that session variable i'm performing the different operation. Problem which is i'm facing is that when i open my 1st page then that session variable is empty & it works as i want but when i open my 2nd page that time session variable get's value & that page also works fine. But when i back to my first page then the session variable having the value & which i don't want. And if i clear the session variable then i'm failed to work with my 3rd page which work on the session value.

I'm unable to explain my whole problem in right manner but if anyone having soluntion on this problem then please reply to this question?

thanks.

It you dont want to use the session variable on the first page and want to use that variable value on the page 2 and 3.

solution 1 is make use of the viewstate or querystring on the page 2 and 3.

Solution 2 is make use of one more flag variable which indicate the seesion varialbe now has the value and based on that you can perform activity when you go back to page 1 from page 2.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM