Google Analytics Alternative

Search This Blog

Sunday, October 24, 2010

Jquey with Webservice in

how to call webservice from JQuery

please find following steps

Please find following steps for

  • Create one WebService in project with DummyTest.asmx

  • [WebService(Namespace = "")]
  • [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  • [System.ComponentModel.ToolboxItem(false)]

  • Create one Webmethod with SessionEnable = true

Public string HelloWorld(string name)
//apply your logic here
Return “Hello World” + name;

  • Come to aspx page and add jQuery Library at top of the page

<script languge=”javascript” src=”jquery-1.3.2.js” ></script>
<script languge=”javascript” src=”jquery-ui-1.7.2.min.js” ></script>

  • ajax method parameters

Type: “Post” or “Get”
URL : your web service file name /Method name
Data : paramert data for webmethod
contentType: "application/json; charset=utf-8"
dataType: "json"
success : function
error : function

No comments: