Redirection problem

The system is done with extjs, AJAX is often used to call the general procedures are webconfig configuration has httpmudole wrote a class, if the session is missing words to the landing interface is now the general page or button operation are possible but the call to Ajax, mudole class Context.Response.Redirect performs, but does not change the address, solving

Started by Alexander at November 07, 2016 - 10:12 PM

The description is not very clear, code can be posted.

Posted by Simon at November 20, 2016 - 10:35 PM

Ajax call process if session is missing, Mark would have to return to session is missing from the mudole class, AJAX according to the mark on the client server returned to reset your browser URL address to the login page. To distinguish between the Ajax request and its browser request, AJAX only as a part of the whole page. The Ajax request on the server side processing will not affect the whole page contains the ajax. To effect this page must be obtained by Ajax response after the preparation of the corresponding JavaScript to operate a page or web browser.

Posted by Haley at December 03, 2016 - 11:12 PM

Starting login set a state value, IsLogon=true, if session has timed out, then a visit to automatic IsLogon into False

Then in the parent page there is a login each page entry, in
protected override void OnInit(EventArgs e)
{
}
There, after a timeout redirection should be handled here

        protected override void OnInit(EventArgs e)
        {
            if (!HttpContextUtility.IsLogon())
            {
                FormsAuthentication.SignOut();
                Response.Redirect("~/Login.aspx");
            }
            else
            {
                 Response.Redirect("The actual page access to URL");
            }

            base.OnInit(e);
        }

Posted by Blithe at December 18, 2016 - 12:05 AM

I know what you mean. But the whole project through a lot of ajax way I may not each page to modify the code in the return value redirection, do you have any good ideas without

Posted by Alexander at December 21, 2016 - 12:49 AM