RadAlert embedding JS code

3 posts, 2 answers
  1. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 06 Apr 2009 Link to this post


    I want to embed in the rad alert JavaScript code to display a running count-down counter.  Is that possible?

  2. Answer
    Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 07 Apr 2009 Link to this post

    Hello Brian,

    Yes, you could do that by modifying the radalert template as shown in the Changing the Dialog Templates help article. Please note that the templates allow standard HTML only - you cannot use server controls in it.

    Best wishes,
    Georgi Tunev
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. Answer
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 07 Apr 2009 Link to this post

    Hello Brian,

    I guess you want to include a running count-down counter in RadAlert for auto closing the alert. I tried following code for that. Please give a try with that.

    <input id="Button5" type="button" value="Show Alert" onclick="showAlert();" /> 

    <script type="text/javascript"
    var rAlert; 
    var alertText = ' Window will colse within 4 seconds'
    function showAlert() 
        var text = 1; 
        rAlert = radalert(alertText); 
        var count = countdown(4000); 
    var c=0; 
    function countdown(c) 
            setTimeout('countdown(' + c + ')',1000); 
            rAlert.get_contentElement().innerText = 'Alert will close within  '+c/1000+ ' seconds'

Back to Top