[CLOSED] about:After login Redirect?

  1. #1

    [CLOSED] about:After login Redirect?



    Hi, I hope this is a simple question.


    login after Redirect to new page


    I use The code,but error Thanks!!


        protected void btnLogin_Click(object sender, AjaxEventArgs e)
        {
            this.Window1.Hide();
            Response.Redirect("Default2.aspx");
        }
  2. #2

    RE: [CLOSED] about:After login Redirect?

    I dont think you can do a server redirect during an ajax callback. You will have to render the necessary javascript back to the client. Also, there's no point in hiding window1 if you are going to change the window.location.
  3. #3

    RE: [CLOSED] about:After login Redirect?

    I confirm that Response.Redirect during AjaxEvent caused the exception. We will investigate it.

    For now you can use next code for redirect

            string href = "AddScript.aspx";
            this.ScriptManager1.AddScript("window.location='" + href + "';");
  4. #4

    RE: [CLOSED] about:After login Redirect?



    Hi wkcode,

    During an AjaxEvent you can only return JavaScript to the Page to executed on a successful return.

    The following code sample demonstrates a simple redirection after an <ext:Button> Click AjaxEvent.

    Example

    <script runat="server">
        protected void Button1_Click(object sender, AjaxEventArgs e)
        {
            this.Button1.AddScript("window.location='MySecurePage.aspx';");
        }
    </script>
    Hope this helps.
    Geoffrey McGill
    Founder
  5. #5

    RE: [CLOSED] about:After login Redirect?

    thanks!!
  6. #6

    RE: [CLOSED] about:After login Redirect?

    We added functionality within the Toolkit to automatically handle a Response.Redirect during an AjaxEvent.

    You no longer need to add the "window.location" script.

    The new code has been committed to SVN and will be publicly available with the v0.7.0 release.

    One other interesting thing we found when researching this problem is that the <asp:UpdatePanel> does not support this functionality either. Apparently there is a work-around for the UpdatePanel, but out-of-the-box a Response.Redirect does not work during an UpdatePanel async postback.
    Geoffrey McGill
    Founder
  7. #7
    Hi all,

    I have the same problem and i have tried to follow your suggestions above but it doesn't redirect to my parent page. Help me please. Thanks.

Similar Threads

  1. login & response.redirect
    By svk in forum 1.x Help
    Replies: 2
    Last Post: Jan 17, 2013, 6:10 AM
  2. [CLOSED] How to redirect after login
    By UnifyEducation in forum 2.x Legacy Premium Help
    Replies: 11
    Last Post: Jun 20, 2012, 1:21 PM
  3. [CLOSED] Differences between X.Redirect and Response.Redirect
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 10, 2012, 4:29 PM
  4. Problem to Redirect To Login Page
    By aniketyadav7 in forum 1.x Help
    Replies: 6
    Last Post: Feb 23, 2012, 7:29 AM
  5. login problem with Ext Login Control
    By Bruce2010 in forum 1.x Help
    Replies: 1
    Last Post: Nov 30, 2010, 4:35 PM

Posting Permissions