Alert Prompt from CodeBehind

5 posts, 1 answers
  1. Kyle Jones
    Kyle Jones avatar
    30 posts
    Member since:
    Jul 2009

    Posted 13 Aug 2009 Link to this post

    Hello,

    I am having a problem and hopefully you can help me solve it.  I want to be able to open up a radwindow from the codebehind and use the radwindows onclientclose function to redirect a user to a different place on my website.  Can you help me out?

    Kyle
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Aug 2009 Link to this post

    Hi Kyle,

    Try the following approach in order to show RadWindow from code behind and to redirect the parent page on closing e the window.

    ASPX:
     
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
        <Windows> 
            <telerik:RadWindow runat="server" OnClientClose="OnClientClose" InitialBehavior="None" 
                NavigateUrl="window.aspx" Left="" Behavior="Default" Top="" Style="display: none;"
            </telerik:RadWindow> 
        </Windows> 
    </telerik:RadWindowManager> 

    C#:
     
    protected void Button1_Click(object sender, EventArgs e) 
        RadWindowManager1.Windows[0].VisibleOnPageLoad = true

    JavaScript:
     
    <script type="text/javascript"
    function OnClientClose() 
        window.location.href = "http://www.google.com"; // Set the url to redirect 
    </script> 
    Also checkout the following documentation:
    Setting Server-Side Properties

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 14 Aug 2009 Link to this post

    Hi Shinu,

    I believe that the following links will be of help as well.

    Sincerely yours,

    Fiko
    the Telerik team

     


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Kyle Jones
    Kyle Jones avatar
    30 posts
    Member since:
    Jul 2009

    Posted 14 Aug 2009 Link to this post

    This is all very helpful but there is one thing that I am seeing that still does not make sense to me and maybe you can help me figure it out.  I see that if I use the scriptmanager then I am able to but in a message to the person like I am wanting too but can't define an onclose attribute cause it it all through scripts.  if I use the RadWindowManager3.Windows[0].VisibleOnPageLoad = true then I cannot put a message into the window but I can define my onclose function.  Is there a best of both worlds.  The purpose of this is to alert a user that there login information has been sent to them in an email and when they close the window that tells them to check there email the page redirects to my login page so they can use said information that was sent to them.

    Thanks,

    Kyle
  6. Kyle Jones
    Kyle Jones avatar
    30 posts
    Member since:
    Jul 2009

    Posted 14 Aug 2009 Link to this post

    Nevermind.  After playing with the code that you gave me I was able to figure out exactly what I needed to to make both ways work as one.  Thanks for the help.

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