radajaxmanager and webpart

4 posts, 0 answers
  1. Marian
    Marian avatar
    4 posts
    Member since:
    Jun 2010

    Posted 16 Mar 2011 Link to this post

    i am creating webpart for sharepoint 2010 and using ajax for grid updating and your other controls, for this i need radajaxmanger. there can be only one radajaxmager on the page.But other webparts can also use ajax with the radajaxmager already added or sometimes without it. What should I do in this situation? If I add radajaxmanerproxy to webpart, but  radajaxmaner can be not added in other webparts. What is the solution?
  2. Nikita Gourme
    Nikita Gourme avatar
    318 posts
    Member since:
    May 2006

    Posted 16 Mar 2011 Link to this post

    In this scenario I would place the ajax manager in the SP2010 site's master page and ajax proxies in the web parts. The main logic is for interaction between ajax manager and proxies is presented in this demo on the telerik site:

    http://demos.telerik.com/aspnet-ajax/ajax/examples/manager/usercontrol/defaultcs.aspx

    Nikita
  3. Marian
    Marian avatar
    4 posts
    Member since:
    Jun 2010

    Posted 16 Mar 2011 Link to this post

    We dont use master pages!!!!!!
  4. Marian
    Marian avatar
    4 posts
    Member since:
    Jun 2010

    Posted 17 Mar 2011 Link to this post

    Problem resolved

     

     

     

     

    protected override void OnInit(EventArgs e)

     

     

    {

     

     

     

    base.OnInit(e);

     

     

     

     

    ScriptManager _script_manager = Telerik.Web.UI.RadScriptManager.GetCurrent(Page);

     

     

     

     

    if (_script_manager == null)

     

     

    {

     

    _script_manager =

     

    new RadScriptManager();

     

     

    _script_manager.ID =

     

    "RadAjaxScriptManagerWebParts";

     

     

     

     

    this.Page.Form.Controls.Add(_script_manager);

     

     

    }

     

     

     

     

     

    Telerik.Web.UI.

     

    RadAjaxManager _ajax_manager = Telerik.Web.UI.RadAjaxManager.GetCurrent(Page);

     

     

     

     

    if (_ajax_manager == null)

     

     

    {

     

     

     

    RadAjaxManager manager = new RadAjaxManager();

     

     

    manager.ID =

     

    "RadAjaxManagerWebparts";

     

     

     

     

    this.Page.Items.Add(typeof(RadAjaxManager), manager);

     

     

     

     

    this.Page.Form.Controls.Add(manager);

     

     

    }

     

    }

Back to Top