Saturday, March 31, 2012

Session timout problem

I can't get WebForm1 to load load automatically after a session timeout, with the following code. How can I do so

In Web.config

<sessionState
mode="InProc
timeout="1"
/

In Global.asax.cs

protected void Session_End(Object sender, EventArgs e

Response.Redirect("WebForm1.aspx")
}i think you do not have to use

timeout = "1"

use

timeout= 1
"mg" <mg@.theworld.com> wrote in message
news:4EB06580-0453-4278-901B-F7D7F34397CE@.microsoft.com...
> I can't get WebForm1 to load load automatically after a session timeout,
with the following code. How can I do so?
> In Web.config:
> <sessionState
> mode="InProc"
> timeout="1"
> />
>
> In Global.asax.cs:
> protected void Session_End(Object sender, EventArgs e)
> {
> Response.Redirect("WebForm1.aspx");
> }
The session_end does not initiate another http request if that's what you're
thinking. However, on the next request the client makes, it should activate
the session_end -- although there are known issues with that. You cannot
always rely on that triggering... do a search for that session_end sub --
also note that in an earlier version of .net that sub's name is different.
In my tests, one works, the other doesn't. I don't know if it's bugged or
what!

-Max

"mg" <mg@.theworld.com> wrote in message
news:4EB06580-0453-4278-901B-F7D7F34397CE@.microsoft.com...
> I can't get WebForm1 to load load automatically after a session timeout,
with the following code. How can I do so?
> In Web.config:
> <sessionState
> mode="InProc"
> timeout="1"
> />
>
> In Global.asax.cs:
> protected void Session_End(Object sender, EventArgs e)
> {
> Response.Redirect("WebForm1.aspx");
> }
sorry timeout="1" is ok in web.config but not if used in aspx page ,in aspx
page it would be session.timeout=1
"Ismail Rajput" <human_to_human@.hotmail.com> wrote in message
news:uF4LmNY%23DHA.3828@.TK2MSFTNGP10.phx.gbl...
> i think you do not have to use
> timeout = "1"
> use
> timeout= 1
> "mg" <mg@.theworld.com> wrote in message
> news:4EB06580-0453-4278-901B-F7D7F34397CE@.microsoft.com...
> > I can't get WebForm1 to load load automatically after a session timeout,
> with the following code. How can I do so?
> > In Web.config:
> > <sessionState
> > mode="InProc"
> > timeout="1"
> > />
> > In Global.asax.cs:
> > protected void Session_End(Object sender, EventArgs e)
> > {
> > Response.Redirect("WebForm1.aspx");
> > }
here is an article to sort out the confusion
http://www.developersdex.com/gurus/articles/746.asp

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Max" <maximus@.portvista.com> wrote in message
news:eQ8_b.66744$jH.539124@.twister.tampabay.rr.com ...
> The session_end does not initiate another http request if that's what
you're
> thinking. However, on the next request the client makes, it should
activate
> the session_end -- although there are known issues with that. You cannot
> always rely on that triggering... do a search for that session_end sub --
> also note that in an earlier version of .net that sub's name is different.
> In my tests, one works, the other doesn't. I don't know if it's bugged or
> what!
> -Max
>
> "mg" <mg@.theworld.com> wrote in message
> news:4EB06580-0453-4278-901B-F7D7F34397CE@.microsoft.com...
> > I can't get WebForm1 to load load automatically after a session timeout,
> with the following code. How can I do so?
> > In Web.config:
> > <sessionState
> > mode="InProc"
> > timeout="1"
> > />
> > In Global.asax.cs:
> > protected void Session_End(Object sender, EventArgs e)
> > {
> > Response.Redirect("WebForm1.aspx");
> > }

0 comments:

Post a Comment