Redirect to same page after login becuse of session time out in asp.net
<p>Hi is there a anyway to land same page after sign in because of session time out in asp.net web application. I am recently migrated from java to .net and any suggestion will be greatly helpful. As a example </p>

<p>I am on <strong>Page1</strong> and while i am idle on <strong>Page1</strong> my session was destroyed and i was redirected to <strong>Logging</strong> page. After i logging to system currently i am on <strong>Default</strong> page. What i want to do is simply redirect to <strong>Page1</strong> after logging. Sorry for my bad English.</p>

<p>Here is Web.config</p>

<pre><code>&lt;authentication mode="Forms"&gt;
&lt;forms loginUrl="~/Login.aspx" timeout="2880"/&gt;
&lt;/authentication&gt;
</code></pre>

<p>and the login button function
    #region"Validate login user"
        public void ValidateUser()
        {</p>

<pre><code>        try
        {
            string con = ConnectionSetting.SQLDBConnectionString();
            sUserNameT = this.txtUname.Text.ToLower();
            sPassWordT = this.txtPassword.Text;
            Some required functions user......

            if (check some stuff)
            {
                Decrypting and other stuff....
                if (matching password)
                {
                    if (if the logging success)
                    {
                        LoadScreensByUser(userbyactive.UserId, con);
                        UserLogedDetails(userbyactive.UserId);//Log User Loging Records.
                        Response.Redirect("~/Main.aspx");
                    }
                    else
                    {
                        Output...();
                    }
                }
                else
                {
                    Output...();
                }
            }
            else
            {
                Output...();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    #endregion
</code></pre>

<p>Here i have provided the minimum required codes..</p>
