Ajax in the code behind

2 posts, 0 answers
  1. Udi
    Udi avatar
    36 posts
    Member since:
    Sep 2010

    Posted 21 Dec 2010 Link to this post

    Hello,

    Is it possible to implement the following code in the code behind on run time only.
    This code prevent post back when sorting the columns in the grid.

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
           <AjaxSettings>
               <telerik:AjaxSetting AjaxControlID="RadGrid1">
                   <UpdatedControls>
                       <telerik:AjaxUpdatedControl ControlID="RadGrid1"  LoadingPanelID="2" />
                   </UpdatedControls>
               </telerik:AjaxSetting>
           </AjaxSettings>
       </telerik:RadAjaxManager>

    I would like to prevent to write it in the html.

    I have tried to write the following code with no results:

    public void Page_Load(object sender, EventArgs e)
            {                       
                RadAjaxManager ajaxManager=new RadAjaxManager();
                ajaxManager.ID = "mkn";
      
                AjaxUpdatedControl ajaxUpdatedControl = new AjaxUpdatedControl("RadGrid1", "2");
      
                  
                AjaxSetting see = new AjaxSetting();           
                see.AjaxControlID = "RadGrid1";
                see.UpdatedControls.Add(ajaxUpdatedControl);
      
                ajaxManager.AjaxSettings.Add(see);//.AddAjaxSetting(RadGrid1, RadGrid1,null);
                        }


    Oren
  2. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 21 Dec 2010 Link to this post

    Hello Oren,

    Please refer to the online resources below for more information about how you can achieve the desired functionality:
    http://www.telerik.com/help/aspnet-ajax/ajax-manager-programmatic-creation.html
    http://www.telerik.com/help/aspnet-ajax/ajxaddajaxsettingsprogrammatically.html

    I hope this gets you started properly.

    Best wishes,
    Pavlina
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top