How to close RadPoupUp window on Button Click

4 posts, 1 answers
  1. Ravi Kumar
    Ravi Kumar avatar
    37 posts
    Member since:
    May 2010

    Posted 13 Jul 2010 Link to this post

    HI,

    I,m using RadWindow as a poupup to set some values in code behind but i want to close popup after setting these values which is not working.
    To close RadWindow popup i,m using the following code
     protected void btnMEOK_OnClick(object sender, EventArgs e)
     {
                          int i = txtMENewPassword.Text.Trim().CompareTo(txtMEConfirmNewPassword.Text.Trim());
                        if (i == 0)
                        {
                            m_Password = txtMENewPassword.Text;
                            lblMESetPassowordError.Text = "";
                            // cloase the window
                            ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", true); // Call client method 
                                                                                                                                                                                      in radwindow page
                        }
                        else
                            lblMESetPassowordError.Text = "New password and confirm new password should be same.";
    }

    JavaScript Code:

     function CloseAndRebind()
             {
                    GetRadWindow().Close();
                    //GetRadWindow().BrowserWindow.refreshGrid(null);
                }
               
                function GetRadWindow()
                {
                    var oWindow = null;
                    if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
                    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz as well)
                       
                    return oWindow;
                }
    Which is calling "CloseAndRebind()" function from code behind.

    please help!

    Regards
    Ravi
  2. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 14 Jul 2010 Link to this post

    Hi Ravi,

    Code looks OK, but I would suggest to put a simple alert() in the CloseAndRebind() function and to make sure that it is actually fired.

    Greetings,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ravi Kumar
    Ravi Kumar avatar
    37 posts
    Member since:
    May 2010

    Posted 14 Jul 2010 Link to this post

    I already have tried alert in function and its not firing.
    regards
    Ravi
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 16 Jul 2010 Link to this post

    Hello Ravi,

    In such case the problem is not related to the RadWindow control. Still, if you open a support ticket and send a sample project where it can be reproduced, we will check it and do our best to help.

    Regards,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top