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

Codebehind problem with radalert

1 Answer 154 Views
This is a migrated thread and some comments may be shown as answers.
Wang Kai
Top achievements
Rank 1
Wang Kai asked on 09 Aug 2008, 06:41 PM
Hi guys.
I wanna use radalert to show some result messages and redirect to another page. For some reason, I have to use it in codebehind.
I've read every article about this question, such as:

I have successfully build my radalert windows from codebehind, it works well, but redirect code was  not work.
I have found that when I using "alert" like this:
string script = "alert('New Password is Created');\n";  
        script += "location.href='loginpage.aspx';\n";  
Page.ClientScript.RegisterStartupScript(GetType(), "msgbox", script, true); 
It works well .

But when I modified it to use radalert like bellow, it didn't work any more.
string radalertscript = "<script language='javascript'> Sys.Application.add_load(function(){var oWnd =radalert('Welcome to RadWindow <b>Prometheus</b>!', 330, 210);oWnd.OnClientClose = function(){window.location.href='loginpage.aspx';}})</script>";  
        Page.ClientScript.RegisterStartupScript(this.GetType(), "radalert", radalertscript);   

Can anyone tell me how to solve this problem?

Any advice would be appreciated, too.


1 Answer, 1 is accepted

Sort by
Georgi Tunev
Telerik team
answered on 11 Aug 2008, 07:10 AM
Hello Wang Kai,

Referencing the radalert dialog as a RadWindow object is possible in the ASP.NET version of the control only. In RadWindow for ASP.NET AJAX, you need to use a modified template of the alert dialog that you can change accordingly to your requirements.

For example:

<telerik:RadWindowManager ID="RadWindowmanager1" runat="server"
        <div class="windowpopup radalert">           
            <div class="dialogtext"
                <a  onclick="$find('{0}').close(); window.location.href = '';" 
                class="radwindowbutton" href="javascript:void(0);"
                    <span class="outerspan"
                        <span class="innerspan">##LOC[OK]##</span> 

Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Asked by
Wang Kai
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question