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 8688993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:31:22+00:00 2026-06-12T23:31:22+00:00

I am a java developer and I am working on .net first time. I

  • 0

I am a java developer and I am working on .net first time. I have used JSON with YUI, but this is first time I am using JQUERY. I have converted Java script object to JSON string using JSON.stringify() and I am getting the same JSON string in code behind, but when I tried to deserialize to the .net object, I am getting the value for property which is Integer, but I not getting the value for String object.

// Client Side

$("#ButtonSave").click(function () {

    //convert gridview to JSON
    var jsonData = new Array();
    $.map($("table[id*=Gridview1] tr"), function (item, index) {
        if ($(item).find("input[type=text]").length > 0) {
            jsonData[index] = new Object();
            jsonData[index].charge = $(item).find("input[type=text][id*=txtCharge]").val();
            jsonData[index].produce = $(item).find("input[type=text][id*=txtProduce]").val();         
            jsonData[index].weight = $(item).find("input[type=text][id*=txtWeight]").val();
            jsonData[index].feet = $(item).find("input[type=text][id*=txtFeet]").val();
            jsonData[index].orderNumber = $(item).find("input[type=text][id*=txtOrderNumber]").val(); 
            jsonData[index].comments = $(item).find("input[type=text][id*=txtComments]").val();
        }
    });

    var jsonStringData = JSON.stringify(jsonData);

    var jqxhr = $.ajax({
        url: "Correction.aspx",
        type: "POST",
        timeout: 10000,
        data: "jsonData=" + jsonStringData
    })
    .error(function () {
        alert('Error');
    })
    .success(function (data) {
        alert('Success');
    });
});

//Code Behind

 If Request.Form("jsonData") IsNot Nothing Then

        Dim cita As New TurnDetailVO
        Dim ser As New JavaScriptSerializer()
        Dim items As List(Of TurnDetailVO) = ser.Deserialize(Of List(Of TurnDetailVO))(Request.Form("jsonData"))

        items.RemoveAt(0)

        For Each cita In items
            Console.WriteLine(cita.CHARGE_ID, cita.PROD_ID)
        Next

 End If

// Value Object

Imports Microsoft.VisualBasic
Imports System.Runtime.Serialization

Public Class TurnDetailVO

Private _CHARGE As String
Private _PROD As String
Private _WEIGHT As Integer
Private _FEET As Integer
Private _ORDER_NUMBER As String    
Private _COMMENTS As String


Public Sub New()

    _CHARGE = " "
    _PROD = " "
    _WEIGHT = 0 
    _FEET = 0
    _ORDER_NUMBER = " "
    _COMMENTS = " "

End Sub



Public Property CHARGE() As String
    Get
        Return _CHARGE
    End Get
    Set(ByVal value As String)
        _CHARGE = value
    End Set
End Property

Public Property PROD() As String
    Get
        Return _PROD
    End Get
    Set(ByVal value As String)
        _PROD = value
    End Set
End Property


Public Property WEIGHT() As Integer
    Get
        Return _WEIGHT
    End Get
    Set(ByVal value As Integer)
        _WEIGHT = value
    End Set
End Property


Public Property FEET() As Integer
    Get
        Return _FEET
    End Get
    Set(ByVal value As Integer)
        _FEET = value
    End Set
End Property

Public Property ORDER_NUMBER() As String
    Get
        Return _ORDER_NUMBER
    End Get
    Set(ByVal value As String)
        _ORDER_NUMBER = value
    End Set
End Property

Public Property COMMENTS() As String
    Get
        Return _COMMENTS
    End Get
    Set(ByVal value As String)
        _COMMENTS = value
    End Set
End Property



Public Function Clone() As TurnDetailVO
    Return DirectCast(Me.MemberwiseClone(), TurnDetailVO)
End Function

End Class

// JSON String

"[null,
{"charge":"T860243","produce":"S877020","weight":"13188","feet":"2898","orderNumber":"AN46270","comments":""},
{"charge":"T860243","produce":"S877021","weight":"13538","feet":"2978","orderNumber":"AN46270","comments":""},
{"charge":"T860243","produce":"S877022","weight":"30118","feet":"6618","orderNumber":"AN46270","comments":""},
{"charge":"T860243","produce":"S877023","weight":"23455","feet":"3345","orderNumber":"AN46270","comments":""}]"
  • 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-12T23:31:23+00:00Added an answer on June 12, 2026 at 11:31 pm

    It looks like the deserializtion isn’t behaving as expected due to two of your field names being different.

    If I changed the property names PROD to PRODUCE and ORDER_NUMBER to ORDERNUMBER I could get it working. Note that you can leave the private field names as they are, it is just the property names that need to change.

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

Sidebar

Related Questions

I am a brand new Java developer (I have been working in asp.net) and
I am a .NET developer by trade, but I am working on a REST
I am new to developing in .NET and C#, but have been a long-time
My background is primarily as a Java Developer, but lately I have been doing
Im basically a .net developer, I am now working on a java web project,
As my name suggests, I am a .NET developer but I have a growing
I have been working on a project for 6 months using net beans ide
I have been working as a Java developer for past 5 years with products
I am working on an iPhone app. I am a full-time Java developer and
I`m an Android developer, and recently started working on JAVA PC project for client.

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.