Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > ASP.NET Espanol
|
ASP.NET Espanol Esta es una lista de correo dedicada al intercambio de conocimiento sobre ASP.NET en el idioma español.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET Espanol section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 3rd, 2005, 05:30 AM
Authorized User
 
Join Date: Aug 2004
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Baby_programmer Send a message via MSN to Baby_programmer Send a message via Yahoo to Baby_programmer
Default Session gets null on Response.Redirect

hi Friends!

Please help me ...i got a problem ...the problem is that im working in ASP.net using VB.NET ....I store a value in a session and as i redirect to another page on click...the session gets nothing...or null.
Please help me.....
I'll be thankfull

ashfaq
__________________
Baby Prgrammer
 
Old April 8th, 2005, 10:48 AM
Authorized User
 
Join Date: Feb 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to deniscuba
Default

are you sure that session in this key have value?

 
Old April 8th, 2005, 03:37 PM
Authorized User
 
Join Date: Feb 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to deniscuba
Default

to resolve this problem i beleive that look the following topic :
http://p2p.wrox.com/topic.asp?TOPIC_ID=12081

 
Old May 13th, 2006, 11:16 PM
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I myself found that inserting EnableSessionState="True" in your top tag (<%@ Page ....) helps with that problem.

 
Old June 15th, 2006, 04:49 AM
Registered User
 
Join Date: Jun 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

  I have the same problem and EnableSessionState didn't help. It seems to happend only on NET2.0. Has anyone found an answer yet?

----------
&nbsp;Siderite
 
Old June 15th, 2006, 05:29 AM
Registered User
 
Join Date: Jun 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Fixed it. The thing is that in the constructor of a page, session is null. This also means members declared with new. Things like "private MyObject mo=new MyObject()" call the ctor or MyObject at the instantiation of the page and if that ctor tries to access HttpContext.Current.Session you get the weird case where Response, Request, Server and Application are not null, but Session is null.
Solution: move the instantiation of classes in the PageLoad event whereever possible and also check for HttpContext.Current.Session!=null.

----------
&nbsp;Siderite





Similar Threads
Thread Thread Starter Forum Replies Last Post
response.redirect ava_h .NET Framework 2.0 0 October 18th, 2006 10:21 PM
Session gets null on Response.Redirect Baby_programmer ASP.NET 1.x and 2.0 Application Design 2 March 11th, 2005 12:38 AM
Session Gets null on Response.Redirect Baby_programmer ASP.NET 1.0 and 1.1 Basics 1 March 8th, 2005 03:30 PM
Session gets Null on Response.Redirect Baby_programmer ASP.NET 1.0 and 1.1 Professional 0 March 3rd, 2005 01:57 AM
response.redirect crmpicco Classic ASP Basics 3 February 9th, 2005 01:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.