1. Add Reference "Ajax.dll".
2. Write To Register.
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
<!-- Add This To Register Ajax. -->
<add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax"/>
</httpHandlers>
3. On Page
using Ajax;
4. Page_Load
public partial class ProgramFiles_Administration_Modules : System.Web.UI.Page
Ajax.Utility.RegisterTypeForAjax(typeof(ProgramFiles_Administration_Modules));
5.
[Ajax.AjaxMethod]
public string InsertValues(string hID)
{
string myVal= hid+" is Fine.";
return myVal.ToString();
}
6. Call C# Method Form Aspx.
Add jquery-1.4.1.min.js
<script type="text/javascript">
var count=1;
function EEEE(ddlvalue)
{
var response = ProgramFiles_Administration_Modules.InsertValues(ddlvalue);
}
</script>
** NOTE: ajax method must be public.
Cheers!!!