Thursday, April 30, 2009

Creating the Ajax Enabled Website using JQUERY

In this article,we will see how to create Ajax Enabled WCF service using Jquery..

The easiest way to create Ajax Enable WCF service is to use Ajax Enabled WCF service templete in visual studio..

Let us go through Example step by step...

Step1:Create an ASP.NET 3.5 Website

Step2:Right click the project>Add New Item>Choose Ajax Enabled WCF Service>name the service as Demo..

Step3:As you see the Demo.cs is added to App_Code.. When you open the Demo.cs by default it is created like this

[ServiceContract(Namespace = "wcfDemo")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

Step4: Add the new method called getdata(int value)

Step5: Open Default.aspx page, In that add Scriptmanager from the toolbox and give its path..

Step6:Now add Html Button and Textbox inside the

Step7: Drag and Drop the Jquery script below

Step8: Now lets create the jquery script

Step9: As we used the datatype as json in jquery script so we need to add these line below the [OperationContract]

I hope you people like this application..

No comments:

Post a Comment