can't close radwindow

6 posts, 0 answers
  1. dan
    dan avatar
    3 posts
    Member since:
    Mar 2016

    Posted 22 Aug Link to this post

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

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

     

    please help.

     

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 23 Aug Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. dan
    dan avatar
    3 posts
    Member since:
    Mar 2016

    Posted 27 Aug Link to this post

    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

     

  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 29 Aug Link to this post

    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.
  6. dan
    dan avatar
    3 posts
    Member since:
    Mar 2016

    Posted 29 Aug Link to this post

    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.

  7. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 30 Aug Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017