Can only have 1 Scriptmanager on a page

2 posts, 0 answers
  1. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 15 Nov 2008 Link to this post

    Hi.. I have a user control hosted in a page that is hosted in a masterpage.
    How can I execute the following code from the usercontrol code behind ?

    If I add an scriptmanager to the usercontrol I get an error...    thanks!




    {radalert('Under Construction...', 250, 100);})"





  2. Kevin Babcock
    Kevin Babcock avatar
    189 posts
    Member since:
    Mar 2007

    Posted 15 Nov 2008 Link to this post

    Hi Jon,

    You can get a reference to the MasterPage's RadAjaxManager by calling the static method RadAjaxManager.GetCurrent() and passing in the current page. From inside a User Control, this would look like this:

    var ajaxManager = RadAjaxManager.GetCurrent(this.Page); 

    Additionally, if you have a need to put a RadAjaxManager in your content page or user control when one is already defined in a MasterPage or parent Page, you can use the RadAjaxManagerProxy.

    I hope that helps. If you have any further questions, please don't hesitate to ask.

    Kevin Babcock
Back to Top