.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

jquery webservice with parameter

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :ASP.Net
how to call web service with jquery in asp.net with param valuethanks in advance

View Complete Post

More Related Resource Links

Writing Data to database with jQuery Forms, ASMX Webservice, & JSON - help!



Can someone point me in the right direction on how to submit data from a jQuery form to a ASMX webservice? I have gotten everything on the form ready to be submitted to the database and now I am stuck on how to send it over using $.ajax(). Everything I have read tells me how to get data from a webservice and display it with jQuery, but not the other direction nor how to access the json data within the within the webservice service(similar to a Request.Form approach with ASP.NET forms).

In other words: 

1. What do I need to do to my webservice to make sure it can receive data from the jQuery form. 

2. What do I need to do in jQuery to receive an acknowledgement the save on the server side was successful. 

I can explain more if need be, but if there is a comprehensive tutorial on not only reading, but also WRITING data with jQuery, JSON, etc. I would love to get pointed in that direction. 

Calling a webservice in MVC using jquery works on dev box not prod box


I have a webservice that is part of the MVC project.  I am using VS 2010 MVC 2.0 on Windows 7.  When I run the web application locally the webservice call works flawlessly, however on the prod box using  2008 upgraded with asp.net 4.0 it fails.

I get an error "The controller for path '/services/traxservices.aspx/upDateCustomer' was not found or does not implement IController. "

Is there some type of issue with the settings in the global.ascx or in IIS that I am missing?


Any help would be appreciated.

problem for using webservice (sql parameter stored Procedure)

i want to put my database layer in the web service. This works fine BUT there is a problem when i am access these methods GetSPData(Byval arg As SqlComman, argCmdText as string, ByVal argSqlConnection as SqlConnection) As DataTable I want to acces the aforesaid method in my Desktop application and i have to send SqlCommand as parament. When i try to acces this (GetSPData) method the follow exception occured "There was an error generating the XML document." Now the problem is to converting DataTable in xmlDocument Or xml node (i dont know about it very much). Can anyone tell me How to send SqlCommand as parament ?? How to convert DataTable into XmlDocument?? When i try to test this method the following Error occurs " test form is only available for methods with primitive types as parameters. " The following are my Web Service Method code in which i try to Get Data Using Stored Procedure and then convert DataTable into XmlDocument and return. Dim XmlDoc As New XmlDocument Dim ds As New DataSet Dim oDBLibrary As New DataBaseLibrary.DatabaseClass Dim dt As DataTable = oDBLibrary.GetSPData(objCommand1, cmdText, msqlConnection) ds.Tables.Add(dt) Dim sw As New StringWriter ds.Tables(0).WriteXml(sw) sw.Close() Dim tableXml As String = sw.ToString XmlDoc.Load(tableXml) Return XmlDoc  Now can anyone tell me what is wrong with that c

How to access webservice using Jquery

Hi to all   I have some queries regarding accessing web service deploy on another server.  I have two project both on same machin under same solution.One is my webservice and another inculde my webproject that access that webservice using jquery .I am using flexigrid control to populate my data.it is working fine when i am trying to use the webservice on my machin under same solution but when i try to use webservice reside on another machin it not working for me.This is my aspx page<script type="text/javascript"> $(document).ready(function() { var SessionUserID = ('<%=Session["UserId"].ToString()%>').val; var myDate = new Date(); var prettyDate = myDate.getDate() + '/' + (myDate.getMonth() + 1) + '/' + myDate.getFullYear(); $("#<%= txtAuctionDate.ClientID %>").val(prettyDate); $("#<%=txthiddenDate.ClientID %>").val(prettyDate); $("#flex1").flexigrid ( { url: 'http://localhost:2158/TWWebService.asmx/getBuyerDealBook', dataType: 'xml', colModel: [ { display: 'LotNo', name: 'LotNo ', width: 120, sortable: true, align: 'left', hide: false }, { display: 'DealNo', name: '

How to add parameter dynamically in jquery & passed it to controller.

my code is like -$("#SelectedIds").val(selectedCheckBox); //i get the ids of selected checkbox here var ss = $("#SelectedIds").val(); // i pass all the ids in a variable var xx= "<%= Url.Action("GetAssignToRequestUrl", "PlanRequest", new { selectedItems = "ss" }) %>"; window.open(xx,"ss",'width=1000px, height=700px'); window.focus(); so in this line i am passing "ss".but in my controller i didnot get the value in a parameter variable, instead i am getting ss as parameter, not the selected ids.how can i do that.Plz help.

jQuery / javascript calling a webservice


I've tried a bunch of different examples and still can't get this to work.

I have a jQuery GalleryView control I'm using and I simply want to log impressions.  I set up a webservice that works, but I can't figure out how to get it to work in javascript.  I have verified that the webservice is working as expected.

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptServ

Unable to get to the webservice using ajax POST jQuery



I need to pass a customer id to get some data back for a customer from a webservice. I can't figure out how to get to the webservice, I have a breakpoint set in the webmethod but it's not being hit and the alert box is not popping up either.  For a test I am just trying to show some value from the returned data in an alert box.  Note I am just hard coding the customer id of 1001. The webmethod takes a parameter of string customerid.

//Webmethod code:

        public customer fetchcustomer(string customerid)
            customerDL custDL = new customerDL();
            return custDL.getData(customerid);



//jQuery code:
   $(document).ready(function() {

            type: "POST",
            contentType: "application/json; charset=utf-8",

Retrieving JQuery Ajax Parameter in ASHX (Handlers) files


Hi everyone;

I have an Jquery Ajax which sends JSON data to an *.ashx file (In data section of JQuery Ajax command). 

Now, I'm asking how can I retrieve this string (data) in my ashx file



jQuery Autocomplete with WebService



I am using the jQuery autocomplete. I get the data bu a WebService. I pretty sure that the WebService return the good value (I checked it with a breakpoint and with firebug's console).

This is the javascript code:

$(document).ready(function() {
        type: "POST",
        url: "WebService.asmx/GetClientFromDb",
        data: "{}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        sucess: function(data) {
                source: data,
                minLength: 0
        error: function() {
            alert("Error in WebService");

The alert box is not fired so I guess the WebService call is a sucess. If someone see my mistake, let me know



GridView Confirmation Box Using JQuery BlockUI in asp.net

JQuery is the most popular JavaScript library. One of the main reasons for its fame is the plugin architecture. Anyone can create a separate library that leverage the JQuery library. In this article we are going to look at the BlockUI library which is used to block the user screen while performing a task.

jQuery $(document).ready() and ASP.NET Ajax asynchronous postback

Many call it the ASP.NET jQuery postback problem, but using the technique below should make it no problem anymore. $(document).ready() isn't called after an asynchronous postback. What this means? You lose the functionality that should be executed within $(document).ready() after an UpdatePanel rendered its contents after an asynchronous postback.

call JavaScript - jQuery code from ASP.NET Server-Side

jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

Making Ajax Callbacks to the Server Using jQuery with ASP.NET

In the first part of this article series I introduced jQuery's functionality and how it provides a rich client side programming model. This time around I'll expand on these concepts and show you how you can use jQuery in combination with ASP.NET using it as an AJAX backend to retrieve data. I'll also discuss how you can create ASP.NET controls and otherwise interact with jQuery content from ASP.NET pages in WebForms.

jQuery is just a JavaScript library so it will work seamlessly with ASP.NET both from page code as well as through backend driven code using the Page.ClientScript object or ScriptManager. You can use jQuery on its own as a client side and Ajax library that communicates with ASP.NET or you can use jQuery in combination with ASP.NET AJAX. The two actually complement each other quite well as jQuery provides functionality that the ASP.NET AJAX library does not and vice versa. For the most part the interaction between the two libraries is trouble free except for a few very rare edge cases.

Displaying Row Details Tooltip on GridView using JQuery

Continuing exploring JQuery! I decided to implement a feature to display some kind of details related to a row displayed on GridView. For example when displaying employees details on GridView some information might not fit in the GridView because it will make it huge and wide. These infomration can be diplayed as Tooltip. Or when you want to display a picture and some kind of formated text to be diplayed as tooltip when mouse hover on the image.

jQuery: Highlight Gridview Rows with Checkbox

Im learning and experimenting with jQuery and ASP.NET. Below is a simple solution I created to highlight rows in a gridview by clicking on a checkbox next to the row.

Gridview setup:

Using jQuery with ASP .NET

With that, JQuery is officially embraced by ASP.NET.

A brief introduction of JQuery

jQuery is the star among the growing list of JavaScript libraries. A few of its characteristics are light-weight, cross-browser compatibility and simplicity. A common task that sometimes takes 10 lines of code with traditional JavaScript can be accomplished with jQuery in just one line of code. For example, if you want to dress up a table with an ID mytable with alternative color for every other row, you can simple do this in jQuery.

Sortable GridView using jQuery's TableSorter

This article explains how to use jQuery's plug-in Tablesorter to implement client-side sorting in an ASP.NET GridView. This comes in handy especially when an ObjectDataSource is used with a GridView as GridView does not provide sorting out of the box.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend