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

Ajax Inside RadWindow Not Working

7 Answers 309 Views
Window
This is a migrated thread and some comments may be shown as answers.
Baal
Top achievements
Rank 1
Baal asked on 07 May 2008, 10:06 PM
Hello,

I have an ASP.NET Ajax Web Application in .NET 2.0. Every pages are wrapped inside an update panel. In one of the pages, I have a RadWindow. The page displayed in the RadWindow is wrapped inside an updatepanel. There are various ajax controls set in there (not rad but the regular ajax controls like TextBoxWaterMark, ModalPopup, Calendar, etc). They all work fine without any problem.

When I put this application in SharePoint, the ajax controls in the RadWindow do not work. RadWindow is popped up with all controls and stylesheet intact. The update panel works, everything is asynchronous. But ajax doesn't work. The calendar doesn't show up, text supposed to be textbox watermark thinks as if it is a regular typed in text, and modal popup doesn't show up.

Is this a bug or am I doing something wrong?

7 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 08 May 2008, 03:32 PM
Hello Baal,

At this point we cannot tell what is causing such problem and we are not sure if the problem is related to the RadWindow control. Since RadWindow is basically an IFRAME, I would suggest to replace the window in your code (just for testing) with a standard IFRAME and see if your code works if it is displayed there. This should help in pinpointing the problem.


Greetings,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jaime Weise
Top achievements
Rank 1
answered on 06 Sep 2009, 06:34 AM
 The problem is directly related to the client id of the OpenerElement you are using. Because .net uses a naming convention for nested controls inside objects that implement INamingContainer you will have a client id named like ctl00_UpdatePanel_MyOpenerElementname. 

This is important because in controls where you have repeating elements, or if you had two controls that nested an element of the same name,you would have client-side naming collisions and things would break. 

What you can do is turn on tracing for your page and then you will be able to search for the part of the name you know, in my case MyOpenerElementname. In the tracing page you will see your element in the form of something like this " ctl00$UpdatePanel$MyOpenerElementname " 

If you replace the dollar signs with underscores (' _ ') you will have the correct client id should like ' ctl00_UpdatePanel_MyOpenerElementname ' this according to my example. The RadWindow should work as long as you are careful you don't re-nest the control changing the client name again.

jaime
0
asilioni
Top achievements
Rank 1
answered on 07 Feb 2012, 06:59 PM
Hi,
i am using a rawdwindow with multiple controls in the content template and i want the content to be updated when a button inside the window is clicked. I try to do so, using a RadAjaxManager but then, radasyncupload control disappears. I also tried to have all the controls of the radwindow inside a RadAjaxPanel, but i don't want to do so, as i am using a rad editor inside radwindow and the function "editor.onParentNodeChanged();" is fired only once...so after ajax, i cannot use my editor!! Do you have any idea? 

Thanks a lot,
Angie
0
Marin Bratanov
Telerik team
answered on 09 Feb 2012, 12:02 PM
Hello Angie,

I advise you start off by examining the following help article on using RadWindow with AJAX properly: http://www.telerik.com/help/aspnet-ajax/radwindow-ajaxifying.html. In short - the update panel should be inside its ContentTemplate. Once used properly there shouldn't be an issue with the RadEditor after the AJAX request - the RadWindow will not be closed and this the content will not be moved in the DOM again. I tried this and things are working properly: http://screencast.com/t/4voj8jVX. I am also attaching my demo page here as a reference. Nevertheless you may find helpful the following resources on using the RadEditor in a RadWindow and with AJAX: RadEditor in RadWindow and Showing RadEditor with AJAX from an initially hidden parent. Finally, you can always inject a call to the onParentNodeChanged() from the code-behind, just make sure the controls are already loaded (i.e. use the Sys.Application.Load event).


All the best,
Marin
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
asilioni
Top achievements
Rank 1
answered on 13 Feb 2012, 11:47 AM
Hi Marin,
Thank you a lot for your reply. I have tried your suggestions by deleting the RadAjaxManager that i have been using in order to update my controls. I have placed an UpdatePanel in the ContentTemplate of my radwindow and i am getting the following error when i debug my project:

Cannot unregister UpdatePanel with ID 'Updatepanel' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.
Parameter name: updatePanel


My radwindow is placed inside a UserControl and not directly to an .ascx page. Also, my radwindow is placed inside a radwindowmanager, could it be a problem?

Thanks a lot,
Angie
0
Marin Bratanov
Telerik team
answered on 13 Feb 2012, 01:11 PM
Hi Angie,

Yes, this is, in a way, causing this error. Please examine the following KB article for detailed information why it occurs, why it is not directly related to the RadControls, but rather to the current scenario, and for a way to work around it: http://www.telerik.com/support/kb/aspnet-ajax/window/cannot-unregister-updatepanel-with-id-updatepanelid-since-it-was-not-registered-with-the-scriptmanager.aspx. You should either take this RadWIndow out of its manager, or use RadAjaxManager. Please note that I did not explicitly advise you to remove it, it can still be used, you only need to provide accurate controls for its settings (i.e. inside the ContentTemplate of the RadWindow only) - this is explained just below the code sample: "If you are using the RadAjaxManager you should not add the RadWindow as an AJAX initiator or as an updated control. Instead, you should directly use the controls from its ContentTemplate in the AJAX settings.".


All the best,
Marin
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
asilioni
Top achievements
Rank 1
answered on 13 Feb 2012, 01:36 PM
Hi Marin,
your suggestion works perfectly for me. I just removed the RadWindowManager.

Thank you very much,
Angie
Tags
Window
Asked by
Baal
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Jaime Weise
Top achievements
Rank 1
asilioni
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or