Ajax Inside RadWindow Not Working

8 posts, 0 answers
  1. Baal
    Baal avatar
    47 posts
    Member since:
    Mar 2008

    Posted 07 May 2008 Link to this post

    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?
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 08 May 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jaime Weise
    Jaime Weise avatar
    25 posts
    Member since:
    Nov 2008

    Posted 06 Sep 2009 Link to this post

     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
  5. asilioni
    asilioni avatar
    17 posts
    Member since:
    Feb 2011

    Posted 07 Feb 2012 Link to this post

    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
  6. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 09 Feb 2012 Link to this post

    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 >>
  7. asilioni
    asilioni avatar
    17 posts
    Member since:
    Feb 2011

    Posted 13 Feb 2012 Link to this post

    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
  8. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 13 Feb 2012 Link to this post

    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 >>
  9. asilioni
    asilioni avatar
    17 posts
    Member since:
    Feb 2011

    Posted 13 Feb 2012 Link to this post

    Hi Marin,
    your suggestion works perfectly for me. I just removed the RadWindowManager.

    Thank you very much,
    Angie
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017