Thursday, August 23, 2007

using AjaxPro2.dll from Michael Schwarz

*Add web Config configuration/configSections

section name="ajaxSettings" type="AjaxPro.AjaxSettingsSectionHandler, AjaxPro.2"



*Add web Config configuration/system.web/httpHandlers
add verb="*" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"



*add reference AjaxPro2.dll into the bin folder
using AjaxPro;

* in page load (postback and not) - add
Utility.RegisterTypeForAjax(typeof(_Default));

*
On client ajax method add attribute
[AjaxMethod(HttpSessionStateRequirement.ReadWrite)]
public string MyAjaxMethod(string username)
{
return "Halo" + UserName;
}


*call in client javascript
_Default.MyAjaxMethod("Kurniawan").value


No comments: