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

How to close RadPoupUp window on Button Click

3 Answers 103 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ravi Kumar
Top achievements
Rank 1
Ravi Kumar asked on 13 Jul 2010, 06:27 AM
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

3 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 14 Jul 2010, 05:48 AM
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
0
Ravi Kumar
Top achievements
Rank 1
answered on 14 Jul 2010, 06:19 AM
I already have tried alert in function and its not firing.
regards
Ravi
0
Georgi Tunev
Telerik team
answered on 16 Jul 2010, 09:12 AM
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
Tags
Window
Asked by
Ravi Kumar
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Ravi Kumar
Top achievements
Rank 1
Share this question
or