This is a migrated thread and some comments may be shown as answers.

Ajax in the code behind

1 Answer 195 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Udi
Top achievements
Rank 1
Udi asked on 21 Dec 2010, 03:42 PM
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

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 21 Dec 2010, 06:17 PM
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.
Tags
Ajax
Asked by
Udi
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or