Ask a Question related to ASP.NET General, Design and Development.
-
Natty Gur #1
Re: Session loses all variables during Response.Redirect
Hi,
Just a hint. If you change anything in the Bin directory of the
application the application will be restart and all the session data
will be lost. Are you writing lo a log file on the Bin directory when
some conditions come true?
Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114
Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377
Know the overall picture
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
[SOLVED] Session loses all variables during Response.Redirect
Ok, don't ask me why, but this solved it: Replace the line: Directory.Move(tempEventDirName, createdEventDirName); With:... -
After redirect back from 3rd party, session variables lost
Thank you in advance. My ASP page 1 redirect user to third party's website, after the process at third party is finished, in 3rd party's... -
Adding variables to response.redirect
I have a page that contains processed variables that I'd like to forward using the response.redirect method. However, because the response.redirect... -
PLEASE - Session Variables OR Response.Write querystring to target frame?
Hi, I'm doing an asp.net app (first one) and NEED to use frames (so please don't tell me not to!). I'm loading a mainframe.htm with two aspx files... -
Redirect to New Browser Window like Response.Redirect
That worked just fine for me as long as you put that open statement on one line rather than 2. "michel" <michely3k@yahoo.com> wrote in... -
fadi #2
Re: Session loses all variables during Response.Redirect
Session management in .NET is very very buggy. I am not sure how Microsoft
shipped .NET with such implementation. There are many reasons (and bugs)
that causes the session to get lost in .NET.
aspnet_wp.exe gets recycled due to lack of memory (which is caused by the
way .Net handles releasing objects from memory) and that removes all stored
sessions for all users. Work around for this is to use StateServer or SQL
Server session management.
Session variables stored in a certain page are not maintained when
redirecting to another page. This I've seen in .NET 2002 but have not tried
to duplicate it in .NET 2003 caused by a bug in .NET. Solution was to
basically delete that page and redo it. If you copy and paste the same code
of the original page it works fine. just got to get rid of the firt page.
Session variables not maintained when redirecting in debug mode. I started
to get this after installing SP2 for .NET 2002. Solution is either not run
in debug mode, or open a browser window before debugging, start debugger
(ignore the browser window opened by the debugger) and test the window you
manually opened.
Thats my experience with the session objects. Your problem does not really
reflect any of the above but worth a shot. Also there might be a size limit,
how big is the image?
fadi
"Mark MacRae" <nospam@nospam.com> wrote in message
news:#lrqqF6SDHA.1920@TK2MSFTNGP11.phx.gbl...a> I have searched the newsgroups for this and found a couple of similar
> situations, but none solved my problem.
>
> Basically the click of a button on one webform saves an entity then
> Response.Redirects back to a list page which lists all the entities in the
> database belonging to the user who is currently logged in.
>
> This works fine most of the time. Except when you use the option to uploadthe> new image as part of the entity. I'm not entirely sure that that is
> relevant though because I have stepped through the code in debug mode and
> the Session still contains 10 variables right up until end of the save
> button click event code which is the Response.Redirect
>
> When I reach the first line of the Page_Load event on the listing page,step> Session has lost all of it's variables. Poof! Gone! Why? Is there asame> in between that I don't know about?
>
> I have seen responses that mention that both ASPX pages must be in theis> project, well they are. And in fact, as I mentioned, the session does not
> lose the variables most times. Only when a new image is uploaded. BelowContext.Request.PhysicalApplicationPath> the chunk of code that is different in that case:
>
>
> if(model.imagePath_NullableString != null) {
> string tempEventDirName = (string)Context.Session["tempDir"];
>
> if(tempEventDirName != null && tempEventDirName != string.Empty &&
> tempEventDirName != "") {
>
> string createdEventDirName => + "/images/listing_files/" + model.pk;
>
> Directory.Move(tempEventDirName, createdEventDirName);
>
> }
>
> }
>
>
fadi Guest
-
Mark MacRae #3
Re: Session loses all variables during Response.Redirect
Thanks for the ideas.
I limit the size of the image to under 20K.
"fadi" <fadiz@nospam.com> wrote in message
news:e9yiXIWTDHA.3700@tk2msftngp13.phx.gbl...stored> Session management in .NET is very very buggy. I am not sure how Microsoft
> shipped .NET with such implementation. There are many reasons (and bugs)
> that causes the session to get lost in .NET.
>
> aspnet_wp.exe gets recycled due to lack of memory (which is caused by the
> way .Net handles releasing objects from memory) and that removes alltried> sessions for all users. Work around for this is to use StateServer or SQL
> Server session management.
>
> Session variables stored in a certain page are not maintained when
> redirecting to another page. This I've seen in .NET 2002 but have notcode> to duplicate it in .NET 2003 caused by a bug in .NET. Solution was to
> basically delete that page and redo it. If you copy and paste the samelimit,> of the original page it works fine. just got to get rid of the firt page.
>
> Session variables not maintained when redirecting in debug mode. I started
> to get this after installing SP2 for .NET 2002. Solution is either not run
> in debug mode, or open a browser window before debugging, start debugger
> (ignore the browser window opened by the debugger) and test the window you
> manually opened.
>
> Thats my experience with the session objects. Your problem does not really
> reflect any of the above but worth a shot. Also there might be a sizethe> how big is the image?
>
> fadi
>
> "Mark MacRae" <nospam@nospam.com> wrote in message
> news:#lrqqF6SDHA.1920@TK2MSFTNGP11.phx.gbl...> > I have searched the newsgroups for this and found a couple of similar
> > situations, but none solved my problem.
> >
> > Basically the click of a button on one webform saves an entity then
> > Response.Redirects back to a list page which lists all the entities inupload> > database belonging to the user who is currently logged in.
> >
> > This works fine most of the time. Except when you use the option toand> a> > new image as part of the entity. I'm not entirely sure that that is
> > relevant though because I have stepped through the code in debug modenot> the> > the Session still contains 10 variables right up until end of the save
> > button click event code which is the Response.Redirect
> >
> > When I reach the first line of the Page_Load event on the listing page,> step> > Session has lost all of it's variables. Poof! Gone! Why? Is there a> same> > in between that I don't know about?
> >
> > I have seen responses that mention that both ASPX pages must be in the> > project, well they are. And in fact, as I mentioned, the session doesBelow> > lose the variables most times. Only when a new image is uploaded.> is> Context.Request.PhysicalApplicationPath> > the chunk of code that is different in that case:
> >
> >
> > if(model.imagePath_NullableString != null) {
> > string tempEventDirName = (string)Context.Session["tempDir"];
> >
> > if(tempEventDirName != null && tempEventDirName != string.Empty &&
> > tempEventDirName != "") {
> >
> > string createdEventDirName =>> > + "/images/listing_files/" + model.pk;
> >
> > Directory.Move(tempEventDirName, createdEventDirName);
> >
> > }
> >
> > }
> >
> >
>
Mark MacRae Guest



Reply With Quote

