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

can't close radwindow

5 Answers 107 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
dan
Top achievements
Rank 1
dan asked on 22 Aug 2016, 02:54 PM

trying to close the radwindow from javascript causes scroll position error:

var radWindow = $find("<%= RadWindow3.ClientID %>");
    radWindow.close();

 

please help.

 

5 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 23 Aug 2016, 10:18 AM

Hello Dan,

Could you explain what the exact problem is?

In the meantime, I suggest you review the following article to see how to get references to the RadWindow in different scenarios, because $find() is not always the correct approach and may cause errors: http://docs.telerik.com/devtools/aspnet-ajax/controls/window/client-side-programming/overview.

In the meantime you may find the follwing resources interesting in case they are similar to your problem: 

Regards,

Marin Bratanov
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
dan
Top achievements
Rank 1
answered on 27 Aug 2016, 10:28 PM

I found that the error javascript error was occuring the in windows ide.  but I have a more insidious problem with window ... it won't close.  it doesn't throw an error, just won't close.  I am sending a zip file with both the parent and child aspx files for your inspection.  perhaps you'll see the error of my ways!

btw, it's a zip file.  remove the .png extension

 

0
Marin Bratanov
Telerik team
answered on 29 Aug 2016, 11:01 AM

Hello Dan,

It is a bit unclear what is the exact hierarchy and which page is opened in the RadWindow.

Nevertheless, what I can suggest is the following:

  1. Make sure there are no other JS errors before you attempt to close the RadWindow. They can stop the scripts execution and still be the cause of the problem.
  2. Remove the AjaxSetting where the window manager updates itself. It is not a postback control and such a setting adds unnecessary update panels. I advise you review the following article on using a RadWindow with AJAX: http://docs.telerik.com/devtools/aspnet-ajax/controls/window/how-to/how-to-use-radwindow-with-ajax.
  3. Avoid using the global scope variable ("window") as a variable name in your scripts. Replace it with something like "wnd" or "rw" or whatever fits your coding style and preferences.
  4. If you are registering the script call that closes the RadWindow from the server, use the Sys.Application.Load event, as shown here
  5. If you are attempting to close a RadWindow with DestroyOnClose==true, add a timeout, as shown here.
  6. If you still cannot resolve the issue, open a support ticket and send us a sample that we can run and debug the problem so we can look into it.

Regards,

Marin Bratanov
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
dan
Top achievements
Rank 1
answered on 29 Aug 2016, 03:05 PM

Hi, Marin,

The hierarchy is:  the "locate.aspx" page is the main page.  It opens the "CheckOut.aspx" page from the "BtnSellPart" image button.  I'm not using ajax per se;  I am using the "OnClientClick" event of buttons calling javascript on the page.

0
Marin Bratanov
Telerik team
answered on 30 Aug 2016, 08:29 AM

Hi Dan,

The BtnSellPart does not have an OnClientClick handler and there is no JS function in Locate.aspx that opens a RadWindow.

Also, see line 89 of Checkout.aspx in the sample I am attaching, it had an unclosed <tr> tag which causes invalid markup. I have also added the proper way to get the RadWindow reference that is shown in the first article I linked (lines 25, 58, 65). I also moved the script manager to the beginning of the form where it belongs in WebForms.

I advise that you compare my sample with your project and migrate the working code so you can start using it.

Regards,

Marin Bratanov
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
General Discussions
Asked by
dan
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
dan
Top achievements
Rank 1
Share this question
or