.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Redirect User After Timeout?

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :ASP.Net

How can I redirect the user to the first page when they've been idle for more than 20 minutes or so?

Here's my session timeout time in my web config file:

<sessionState timeout="20"/>



View Complete Post

More Related Resource Links

how to redirect user to login page if session is null

i have 2 page,1.login.aspx ---  2.welcome.aspxin my login.aspx im storing username into sesssion as below:Session["usernm"] = txtUsername.Text;in my welcome.aspx  pagein page_load event if (Session["usernm"]==null)        {            Response.Redirect("Login.aspx");        }----- here if i manulally paste the url ( http://localhost:4125/Loginado/welcome.aspx) it should go to  login.aspx for user credentialsbut its going directly to welcome.aspx  page.

Redirect to specific page based on user Roles

I am using Formsauthentication. My situation is as per below:the login form has codebehind :==============================protected void LoginButton_Click(object sender, EventArgs e)        {            TextBox uname = Login1.FindControl("UserName") as TextBox;            TextBox pass = Login1.FindControl("Password") as TextBox;            CheckBox rm = Login1.FindControl("RememberMe") as CheckBox;            Literal fail = Login1.FindControl("Literal1") as Literal;            if (Membership.ValidateUser(uname.Text, pass.Text))            {                /                FormsAuthentication.SetAuthCookie(uname.Text, rm.Checked);                            }        &

Notify user of forms authentication timeout

When the forms authentication cookie expires, I'm trying to override the default behavior of redirecting to the login page, and pass a value on the querystring (timeout=true), so I can inform the user what has happened.I'm prepared to work out the logic to know if they have actually timed out or not, I just don't know the best place to override where the response is redirected to the login page.  The best place I can find is "FormsAuthentication_OnAuthenticate", but perhaps you know of a better place?Thanks!

Check session timeout and warn user before timeout


I know there are several articles explaining how to warn the user before their session times out, but so far none of them have worked for our scenario, so I'm hoping someone here will be able to help me figure this one out...  Here's what we've got:

Our application uses SQLServer to store session state.  We've got it set to timeout in 60 minutes.  Unfortunately (I fought hard against this, but lost the battle) our application uses popups for several major screens.  So tracking the session timeout on the client side doesn't really work, because I have no idea what window the user is in at any given point.  I've tried the solution where you inject Javascript into the page using the current session timeout on each request, but again, because the user could be actively using the application in a different window, it doesn't work for us.  So I guess I have a couple key questions:

  1. Is there any way to get the timeout for a session without triggering a request to the server, which would just renew the session?
  2. Is there a way to track the session timeout value across multiple windows? 
    I believe there is a limit to the number of "branches" the main window can have in our app.  In other words, the user can only be 2 levels deep from the main/root window, s

Set session Timeout and Auto Redirect



I am creating web application. In that I want to set session timeout (not idle timeout). If a user logged in that time the session time will start and it automatically should detect session timeout the page should redirect to another page. How can I acheive this.

redirect only one user for that page



I have asp.net membership login in my asp.net application in that i have 30 users, What i need is

I have one xxxx.aspx page if user name 'John' is logged in then i need to redirect to that page xxxx.aspx and other user will not able logged in to that page except 'john'.. so let me know how to do this

Variation 2010: Redirect the user

Hello guys, I am using SharePoint Variations 2010. Is there any way to hide the default language selector from the drop down menu, as I want to provide language links on the MasterPage instead! Do I need to alter this user control VariationsRootLanding.ascx!

Ajax timeout redirect to login again



I have some problems whereby sometimes my application redirects to the login page if the users sessions timesout.

What I'm finding though is that pages that are ajaxified with update panels etc don't appear to redirect to the login correctly.

Meaning that my users come back and click a button and a horrible 'object not set to an instance of an object' error appears.

I was wondering if anyone has a fix for this - or if they recommend some javascript on the page to return the user to login (and therefore load session stuff).


User Timeout

Users are getting logged out of the sharepoint site after several minutes of idle time. Have been unable to locate the timeout settings to increase or turn off timeout. Anyone know where to find this in central admin?

session timeout redirect in ajax calls


If a normal session timeout occurs we could handle the session timeout.

But say we are using a lot of ajax calls, webhandlers etc. How would we catch session timeout here and redirect to error/login page.


C# button to redirect user to a custom newform sharepoint page


I want to place a button in my C# web part  that will take the user to a new custom NewForm.aspx page I created.   I'm assuming this is straightforward but I can't find an example of the onClick event.  Can someone please assist?


Redirect user to login page and back


How would I go about to solve this:

When the user clicks a button and the user has been inactive for too long (session is gone), then redirect the user to the login page and back to the current page after logging in?

Is there a built in solution to this or do I have to do it manually? If so, how?



How to redirect logged in user based on role



I want to know how can i redirect a user to a different page when he tries to access a page restricted to another role?

The scenario is as follows:

 I have a folder "Gestao" that only allows users in role "Administrator"

            <!--<allow roles="Administrators"/>
        <deny users="*"/>-->

If an anonymous user tries to access that folder he is redirected to the login page, but if a logged in user whose role is "friend" tries to access this folder he is also redirected to the login page. I want to redirect him to a page showing a message that he has no permission to access that page/area.

How can I do that? Should i have code on the Page_load event of the login page checking the user role and then redirect him to the correct page? Or is there some otherway to do this?

Thanks in advance!
Rui Palhinhas


Using workflow to redirect a user to a certain website?


Is it possible to use workflow to redirect a browser to a specific website after a list item is submitted? 

If so, can someone please point me in the correct direction in setting this up?


Which event of an httpmodule do i use to redirect a user after he is authenticated?


I want my application to send the user to the page he last visited (stored in a cookie).

If i want to do this using an http module then in which event of the module should i do this?


MS SQL Server: Disconnect Users From Database - Kill User Session

If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

Choosing Between a User Control or Web Part for SharePoint

SharePoint will only display Web Parts on a page. However, there are publicly available shims that allow you to write user controls and have them be displayed as a Web Part. From SharePoint's point of view, the shim is a Web Part. From the point of view of the user control, the shim is simply a control in .NET that is including the user control
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend