This is a migrated thread and some comments may be shown as answers.

Alert Prompt from CodeBehind

4 Answers 174 Views
Window
This is a migrated thread and some comments may be shown as answers.
Kyle Jones
Top achievements
Rank 1
Kyle Jones asked on 13 Aug 2009, 03:30 PM
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

4 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 14 Aug 2009, 06:10 AM
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.
0
Fiko
Telerik team
answered on 14 Aug 2009, 12:34 PM
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.
0
Kyle Jones
Top achievements
Rank 1
answered on 14 Aug 2009, 01:18 PM
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
0
Kyle Jones
Top achievements
Rank 1
answered on 14 Aug 2009, 01:35 PM
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
Tags
Window
Asked by
Kyle Jones
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Fiko
Telerik team
Kyle Jones
Top achievements
Rank 1
Share this question
or