Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>yup i got the solution</p> <p>This is my updated JQuery</p> <pre><code>pmamml.ButtonClick = function() { $.fn.serializeObject = function() { var o = {}; var a = this.serializeArray(); $.each(a, function() { if (o[this.name] !== undefined) { if (!o[this.name].push) { o[this.name] = [o[this.name]]; } o[this.name].push(this.value || ''); } else { o[this.name] = this.value || ''; } }); return o; }; var stringJson = JSON.stringify($('#form1').serializeObject()); var Userdata = "formData=" + stringJson; $.ajax({ type: 'GET', url: 'http://URL/Service.svc/Update?' + Userdata, error: pmamml.ajaxError, success: function(response, status, xhr) { if (response = true) { //alert(response); alert("Data Updated Successfully"); } } }); </code></pre> <p>}</p> <p>In above method formData will pass the JSON string like below: { "FirstName":"Raja","MiddleName":"Raja","LastName":"Kumar"}.</p> <p>And in my WCF Service, converted this JSON string to Object.</p> <pre><code>[WebInvoke(Method = "GET", UriTemplate = "/Update?formData={formData}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] public bool Update(string formData) { var mlParser = new MLParser(); System.Web.Script.Serialization.JavaScriptSerializer s = new System.Web.Script.Serialization.JavaScriptSerializer(); var InfoList = s.Deserialize&lt;Users&gt;(formData); return mlParser.Update(InfoList); } public class Users { public string FirstName { get; set; } public string MiddleName { get; set; } public string LastName { get; set; } } </code></pre> <p>This is working fine.</p> <p>Thnak you all for your kind response.. :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload