RadAlert not working while calling it on codebehind and returntoparent page.

Thread is closed for posting
2 posts, 0 answers
  1. Manoj
    Manoj avatar
    12 posts
    Member since:
    Aug 2010

    Posted 06 Dec 2010 Link to this post

    Hi freinds,
    I am using radalert in codebehind for displaying message and after desplaying message am calling another javascript function to retun to the parent page.
    following is my code.

    private

     

    bool UpdateCounter()

     

    {

     

     

        string radalerts = "<script language='javascript'>function save(){radalert('Counter Saved Succesfully!', 330, 210); Sys.Application.remove_load(save);};     Sys.Application.add_load(save);</script>";

     

    Page.ClientScript.RegisterStartupScript(

     

    this.GetType(), "radalert", radalerts);
    return true;

     

    }

     

    if

     

     

    (UpdateCounter())

     

    {

    hdnChange.Value =

     

    "Y";

     

    ClearControl();

    Page.RegisterStartupScript(

     

    "myScript", "<script language=JavaScript>returnToParent();</script>");

     

    }

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> 
    <script type="text/javascript"> 
    function returnToParent() { 
    var oArg = new Object(); 
    var oWnd = GetRadWindow(); 
    oArg.IsChange = $get(
    "<%=hdnChange.ClientID%>").value;

     

     

    oWnd.close(oArg);

    }

     

     

    </script>

     

     

     

    </telerik:RadCodeBlock>

    but my radalert not displaying any message its just close the popup window and return to parent window without showing any radalert.

    What is the wrong with above.
    please help
    Thanks in advance.
    Manoj Gupta

     

     

     

     

  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 07 Dec 2010 Link to this post

    Hi Manoj,

    radalert cannot block the execution thread. I would suggest to output the radalert dialog from the server and use JavaScript to close the RadWindow when the radalert dialog is closed.
    e.g.
    var oWnd = radalert("alert message");
    oWnd.add_close(returnToParent);


    Greetings,
    Georgi Tunev
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top