Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8204041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:46:03+00:00 2026-06-07T07:46:03+00:00

Hi can anybody help me out from this. I have an HTML page. This

  • 0

Hi can anybody help me out from this.

I have an HTML page. This page contains Textboxes for FirstName,MiddleName, LastName, etc.

On button clcik of this HTML page i am calling a javascript function. Here i am getting all the HTML page contaols and its value using JQuery Serialization. Then passing this values to my WCF service hosted in server.

This service will parse this string into corresponding objects and save the values into the database.

So In HTMl page i written the Javascript function like below:

pmamml.ButtonClick = function() {
var formData = $("#form1").serializeArray();
var stringJson;
$.getJSON('ajax/test.json', function(formData) {
   stringJson=  JSON.stringify(formData)
});
//alert(stringJson);
$.ajax({
    type: 'GET',
    url: 'http://URL/Service.svc/Update?formData=' + JSON.stringify(formData),
    error: pmamml.ajaxError,
    success: function(msg) {
        document.write(msg);
        //alert(msg);
    },
});},

And in WCF service i written:

[WebInvoke(Method = "GET", UriTemplate = "/Update?formData={formData}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
    public string Update(string formData)
    {
        //   Here i am receiving formdata string as
        // formData = "[{\"name\":\"FirstName\",\"value\":\"Pankaj\"},{\"name\":\"MiddleName\",\"value\":\" \"},{\"name\":\"LastName\",\"value\":\"KUMAR\"}]";
    }

I wanna deserialize this string into List object or keyvaluepair or Dictionary any one of the above format.

So that i can save this value into database.

How can we do this. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:46:05+00:00Added an answer on June 7, 2026 at 7:46 am

    yup i got the solution

    This is my updated JQuery

    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");
            }
        }
    });
    

    }

    In above method formData will pass the JSON string like below:
    { “FirstName”:”Raja”,”MiddleName”:”Raja”,”LastName”:”Kumar”}.

    And in my WCF Service, converted this JSON string to Object.

    [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<Users>(formData);
    
            return mlParser.Update(InfoList);
        }
    
    
    
    public class Users
    {
        public string FirstName { get; set; }
        public string MiddleName { get; set; }
        public string LastName { get; set; }
    }
    

    This is working fine.

    Thnak you all for your kind response.. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anybody help me how can I invoke a JSP page from a Servlet
Can anybody help me in this? I want to get an screenshot from an
I am not that expert in SSIS. Can anybody help me out on my
Can anybody help me in finding out how to verify that _tmkdir succeeded. For
can anybody help me understand how Honda achieved this effect: http://testdays.hondamoto.ch/ I mean the
Can anybody help me with retrieving some elements from the following example text: sdfaasdflj
Can anybody help me with this simple code?? #include <iostream> using namespace std; void
Can anybody help me out? I would like to store a hex colorPicker value
Can anybody help me to find out how to call rrd_update_r function of the
Can any body help me out how to clear the items in the list

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.