RADWINDOW - Response Redirect

8 posts, 0 answers
  1. Narsing
    Narsing avatar
    4 posts
    Member since:
    Dec 2008

    Posted 26 Dec 2011 Link to this post

    Consider an example.....

    a) I display a web-page "Page1.aspx"  in rad-window.....and inside this web-page on a button click i response.redirect to another web-page "Page2.aspx"..How do i make this  "Page2.aspx" open in the same window but do not display in "RadWindow".


    Thanks
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Dec 2011 Link to this post

    Hello,

    Try the following.
    ASPX:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
      <Windows>
         <telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true">
             <ContentTemplate>
                 <asp:Button ID="Button1" runat="server" Text="Redirect" OnClick="Button1_Click" />
              </ContentTemplate>
          </telerik:RadWindow>
      </Windows>
    </telerik:RadWindowManager>

    CS:
    protected void Button1_Click(object sender, EventArgs e)
      {
        Response.Redirect("Default2.aspx");
      }

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 27 Dec 2011 Link to this post

    Hello Narsing,

    As far as I understand you are using a RadWindow with NavigateUrl instead of a ContentTemplate as Shinu thought. If so, to achieve waht you want you should go through the following steps:


    1) Use the Response.Redirect method in the server handler of the button of Page1.aspx.
    2) Put the following script in Page2.aspx:


    if (window != window.top) window.top.location.href = window.location.href;


    The step in 1) will cause the Page2.aspx to start loading and the code from 2) will force it to load in the main browser window instead of the RadWindow.



    Please, test my suggestion and let me know how it goes. 

    All the best,
    Svetlina Anati
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  5. Dev
    Dev avatar
    2 posts
    Member since:
    Nov 2011

    Posted 08 Feb 2013 Link to this post

    Thank You Svetlina Anati. It did work. I had the same issue and it worked for me.
     Thank you. But the problem is page 2 showed up in the rad window for a moment before opening in the same window. In addition i have used the line of code you just mentioned in my document.ready function on page 2. How can i avoid the momentary opening of page 2 on the rad window? 

  6. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 11 Feb 2013 Link to this post

    Hi,

    In order for this framebuster script to work it has to be reached by the browser, so the page must first start downloading in the RadWindow. The earlier the script is executed, the earlier it will redirect the main page, so the beginning of the head section is the best place for it.


    All the best,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  7. Varun
    Varun avatar
    13 posts
    Member since:
    Sep 2013

    Posted 13 Nov 2013 Link to this post

     Hi,
    I have apply a master page to rad window....
    In Master Page there is a user control which containg Hyperlink ...
    I want to redirect to plane .aspx page from hyperlink and want to close the radwindow..
    Pls let me know solution for above....

  8. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 14 Nov 2013 Link to this post

    Hi Varun,

    If the hyperlink is in the RadWindow and you want it to open in the browser itself you should add the target="_top" attribute to it, because RadWIndow loads its content page in an iframe.
    At this point the main page will be redirected and the RadWindow will be lost.


    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  9. Varun
    Varun avatar
    13 posts
    Member since:
    Sep 2013

    Posted 15 Nov 2013 Link to this post

    HI Marin,

    Thank you so much for above solution ....
    Its working....


    Varun
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017