AJAX Control Toolkit controls in a UserControl

Last post 05-09-2008 6:12 AM by jon_fma. 5 replies.

Sort Posts:

  • AJAX Control Toolkit controls in a UserControl

    05-08-2008, 4:54 AM
    • Loading...
    • jon_fma
    • Joined on 05-08-2008, 4:28 AM
    • Posts 3

    Hi guys

    Sorry if this has been asked many times before - I did a quick forum search and couldn't find anyone who had asked or answered this before.

    I'm having trouble with where to position a ScriptManager control when wanting to put an Accordion control in a User Control for re-use across multiple master pages.

    If I place the ScriptManager in a MasterPage, the UserControl gives an error message along the lines of "The control with ID 'accMenu_AccordionExtender' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it" But if I put it in the UserControl it complains about only one ScriptManager being allowable per page. This error obviously disappears if I take the ScriptManager out of the MasterPage, but I would much rather have the one ScriptManager allowable in the MasterPage, and presumably this error will re-occur if I have two UserControls in a page that both have a ScriptManager in?

    So far, Google (or should that be Live Search?) has only hinted at the possibility of placing a ScriptManagerProxy in the page, but that doesn't seem to have solved the problem. The code for the ScriptManagerProxy I'm putting in the usercontrol is: 

    <asp:ScriptManagerProxy ID="scriptManagerProxy" runat="server"></asp:ScriptManagerProxy>
    

    Has anyone solved this problem?

    Hope this is clearer than ill-informed gobbledygook, but please ask further questions if there's anything unclear.

    Thanks

    Jon
     

  • Re: AJAX Control Toolkit controls in a UserControl

    05-08-2008, 6:44 AM
    • Loading...
    • mohsinaeem
    • Joined on 05-08-2008, 7:41 AM
    • Lahore, Pakistan
    • Posts 8

    Try to put your scriptmanager in your masterpage <head> section. I think it solves your problem. Use scriptmanagerproxy into your controls, if needed.

    Mohsin Naeem
    MCPD
    eWorx International
  • Re: AJAX Control Toolkit controls in a UserControl

    05-08-2008, 7:05 AM
    • Loading...
    • jon_fma
    • Joined on 05-08-2008, 4:28 AM
    • Posts 3

    Thanks for the suggestion - I'd not come across that idea or tried it before.

    Sadly, it didn't work. 

  • Re: AJAX Control Toolkit controls in a UserControl

    05-08-2008, 7:23 AM
    • Loading...
    • Swati Jain
    • Joined on 05-24-2006, 12:29 PM
    • Pune
    • Posts 675

    Hi

    This is the article by Haider which shows  how to implement usercontrols with script manager and updatepanel

    This may help you  http://aspalliance.com/1274_Tips_and_Tricks_ASPNET_AJAX_10_and_User_Controls.all

    If  your problem conflicts with given example ,pls let me know  with source code in details

    thanx

    Swati

  • Re: AJAX Control Toolkit controls in a UserControl

    05-08-2008, 1:30 PM
    • Loading...
    • vgiambattista
    • Joined on 01-13-2006, 2:40 PM
    • Atlanta, GA
    • Posts 91

    Jon,

    I've run across this before and it seems to be a designer problem.  I would get the exception message in the designer, but the control actually worked fine when I ran the app.

    Is this how it is for you?

    James

    James Ashley, Magenic Technologies
    (james.ashley.magenic@gmail.com)
  • Re: AJAX Control Toolkit controls in a UserControl

    05-09-2008, 6:12 AM
    • Loading...
    • jon_fma
    • Joined on 05-08-2008, 4:28 AM
    • Posts 3

    @Swati: Thanks for posting the link - unfortunately, he didn't seem to be looking to use the AJAX Control Toolkit controls, but just standard ASP.NET controls in an UpdatePanel, which doesn't seem to be what I'm after.

    @James: No, I'm not getting any errors reported at design or build time within Visual Studio. I'm getting a "Yellow page of death" ASP.NET server-side error when I try and load a page with the AJAXy UserControl on it.

    The project I'm working on has quite a tight deadline, so I've abandoned the use of the AJAX control toolkit Accordion for the moment - going with a Prototype/Scriptaculous based solution now. However, I'm still interested in any insights people might have as I'm sure I'll hit against this again in the future.

    Thanks for all the comments and input so far :)

    Jon
     

Page 1 of 1 (6 items)