kamagra how much to take

Best Approach To Adding Telerik Ajax Settings To SharePoint WebPart

This is the most effective way I have found to add the appropriate AJAX settings to a SharePoint WebPart. This differs from how you would add the settings within a normal ASP.NET context. There are a couple of assumptions that are placed within the code. Firstly, a Panel is going to be leveraged as the primary holder for a series of controls, and I am also going to call a recreate method for reliability of control recreation. This method should be called from the WebPart’s OnLoad event.

Using the below helper method:

  1.  private void AddAjaxSettings()
  2.  
  3. {
  4.  
  5. RadAjaxManager current = RadAjaxManager.GetCurrent(Page);
  6.  
  7. AjaxSetting ajaxSetting = new AjaxSetting([This Is Your Panel].ID);
  8.  
  9. AjaxUpdatedControl newItem = new AjaxUpdatedControl
  10.  
  11. {
  12.  
  13. ControlID = [This Is Your Panel].ID,
  14.  
  15. LoadingPanelID = LoadingPanel.ID
  16.  
  17. };
  18.  
  19. ajaxSetting.UpdatedControls.Add(newItem);
  20.  
  21. current.AjaxSettings.Add(ajaxSetting);
  22.  
  23. ajaxSetting = new AjaxSetting(current.ID);
  24.  
  25. AjaxUpdatedControl ajaxUpdatedControl = new AjaxUpdatedControl
  26.  
  27. {
  28.  
  29. ControlID =  [This Is Your Panel].ID,
  30.  
  31. LoadingPanelID = LoadingPanel.ID
  32.  
  33. };
  34.  
  35. ajaxSetting.UpdatedControls.Add(ajaxUpdatedControl);
  36.  
  37. current.AjaxSettings.Add(ajaxSetting);
  38.  
  39. AjaxManager.AjaxRequest += (sender, args) => RecreateControlStructure(args.Argument);
  40. }

In the above replace  [This Is Your Panel] with your Panel control reference since this will be at the field level. Then you are ready to read the properties in the RecreateControlStructure method using a method like:

  1. Dictionary<string, object> designerData = new JavaScriptSerializer().Deserialize<Dictionary<string, object>>(argument);
  2. object value;
  3. designerData.TryGetValue("A Property", out value);
Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>