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

JavaScript add_close RadWindow Function Not Working in Chrome or Firefox Browser

1 Answer 159 Views
Window
This is a migrated thread and some comments may be shown as answers.
Erin
Top achievements
Rank 1
Erin asked on 24 Jan 2013, 04:41 PM
My project uses the JavaScript add_close function to attach an OnClientClose event handler to a RadWindow.  The functionality is very similar to the one in the Returning Values from a Dialog example project.  The only difference is that it uses the add_close function described in this RadWindow documentation instead of setting the OnClientClose property. 

I initially developed for Internet Explorer, which has been working perfectly well, but now we find that it doesn't work in Chrome or Firefox.  I put an alert within the OnClientClose function, and it is never being reached.  Can you explain what is different about these browsers that prevents the function from working?

A few extra bits of information, for context: 
  • I have never gotten an error, as some people have experienced.  It never seems to be looking for a function that doesn't exist, it just doesn't try to call the function.
  • The window I am opening has a content URL of another .aspx page within my project.  The window's content does not exist on the same .aspx page, because it needs to be able to direct to different URLs based on certain user input.
  • The window is closed by clicking an "OK" button, which calls a returnToParent function which attaches a result then calls oWnd.close(oArg), just like in the example mentioned above

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 28 Jan 2013, 12:36 PM
Hi Erin,

Can you confirm the function you are trying to add is on the same page where the RadWindows are declared? The handlers must be in the same context and added in the same context where the control's object resides (i.e. the main page). This should not be done in the content page. Other than this, I am aware of only one reason for experiencing such behavior without having a JavaScript error - using the AjaxControlToolkit assembly. It changes the MS AJAX scripts and breaks various things, including dynamic handlers. Usually, having DestroyOnClose=true for the RadWindow in question is required for seeing this problem, but this may not be the case with newer versions of ACT.

In a summary, what I can suggest is:
- confirm the handlers are present and are attached in the main page, not in the content page
- try removing the AjaxControlToolki assembly if present (even from the bin, not only as a reference)
- try adding a static handler in the markup, if possible for your scenario. In case it is needed only conditionally you can add a flag to check for in its beginning and return; if it is not satisfied

If none of this helps I advise that you open a support ticket and send us a simple, runnable project we can use to reproduce this behavior in order to investigate it.


Kind regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Window
Asked by
Erin
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or