Redirect To other Page From Global.asax

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
6/12/2013 6:19:24 AM
Gravatar
Total Posts 11

Redirect To other Page From Global.asax

Hello Joe,

i have developed an application on mojoportal.

now i want to redirect on login page from Session_End method which is in Global.asax file .

but i am unable to do it .

please help me.

 

Thanks

Amit Kumar Bhatt

6/12/2013 7:31:08 AM
Gravatar
Total Posts 18439

Re: Redirect To other Page From Global.asax

Hi Amit,

1. You should not modify global.asax.cs or any other mojoPortal code. If you do that then I do not offer you any help or support at all. No-one on this site provides help with forked versions of mojoPortal.

2. If you understood what session is or how session end event is triggered you would already know it is impossible to redirect from session end event. A redirect can only be done in the context of a web request. By definition session end occurs after a period of time (20 minutes by default) of no web requests by the user. With no web request there is nothing to redirect and if there was a web request then the session end would not happen. So it is impossible to ever redirect from that event.

Joe

6/12/2013 7:48:11 AM
Gravatar
Total Posts 11

Re: Redirect To other Page From Global.asax

ok Thanks

6/12/2013 8:02:57 AM
Gravatar
Total Posts 11

Re: Redirect To other Page From Global.asax

hello Joe,

i just want to redirect on login page when user do not perform any activity upto 5 minites.

can you please give me any suggestion.

 

Thanks 

Amit Kumar Bhatt

6/12/2013 9:13:00 AM
Gravatar
Total Posts 18439

Re: Redirect To other Page From Global.asax

As stated already a redirect is something we can do to a web request, ie the web browser requests an url and we can redirect to a different one. With no web request there is nothing to redirect and we don't even know if the user still has his web browser open or not.

My suggestion is just configure a short session timeout and in site settings don't check the box to allow persistent login so if the session times out then the user is no longer logged in and any protected page would redirect him to login if he makes a new request.

For more info see Controlling Browser Sessions

Hope that helps,

Joe

6/12/2013 10:53:12 AM
Gravatar
Total Posts 2245

Re: Redirect To other Page From Global.asax

Hi,

You could create a JS to count down from the last interaction with the site and when the counter reaches zero redirect the user. This is all done client side, not server side. I see a lot of banks doing this and honestly I find it very annoying.

HTH,
Joe D.

You must sign in to post in the forums. This thread is closed to new posts.