JSON ASP.NET Web Services with jQuery

using System; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; using System.Web.Script.Services; using System.Collections.Generic; using System.Linq; public class Employee { public string firstname; public string lastname; public int age; } /// /// Summary description for Employeeservice /// [WebService(Namespace = “http://tempuri.org/”)] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ScriptService] public class Employeeservice : WebService { List Employees = new List{ new Employee{firstname=”Aamir”,lastname=”Hasan”,age=20}, …

JSON ASP.NET Web Services with JavaScript

——————————————WebForm1.aspx—————————————— // This function calls the Web service method // passing simple type parameters and the // callback function function CallWebMethod() { // debugger; var User_Name = document.getElementById(”).value; checkDuplicateUserName.WebService1.CheckDuplicate(User_Name, OnSucceeded, OnError); } // This is the callback function invoked if the Web service // succeeded function OnSucceeded(result) { var rsltElement = document.getElementById(“lblDuplicate”); rsltElement.innerHTML = “”; …