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

[Solved] How can I automatically close a RadWindow after a couple seconds?

1 Answer 346 Views
Window
This is a migrated thread and some comments may be shown as answers.
bemara57
Top achievements
Rank 1
bemara57 asked on 17 Apr 2008, 05:55 PM
I invoke a RadWindow with radalert like this:
radalert('An <br /><b>html</b> string.<br />', 200, 100,'My Alert'); return false;

Is there a way to close the alert automatically after 2 seconds?

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 21 Apr 2008, 10:53 AM
Hi Basem,

You can close the alert automatically. Please, review the following code:

<telerik:RadWindowManager id="RadWinMan1" runat=server></telerik:RadWindowManager>  
<script type="text/javascript">  
function showAndHideAlert()  
{  
    var alrt = radalert('Welcome to RadWindow!', 330, 100);  
 
    window.setTimeout(function ()  
    {  
        alrt.close();  
    },1500);  
}  
</script>  
<button onclick = "showAndHideAlert(); return false;">show ALERT BOX</button><br/> 


I hope this helps.

Best regards,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Window
Asked by
bemara57
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or