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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:18:07+00:00 2026-05-27T10:18:07+00:00

I am using JSON in Javascript for first time in my project of asp.net.

  • 0

I am using JSON in Javascript for first time in my project of asp.net. I am new to it.
I have successfully created a JSON string on page load and stored it in a hidden field.
Now, in Javascript when I try to eval or parse that string, it do not parse it.

Please help. Here’s how I’m doing it:

var jsonText = $("#hiddenJson").val();

var jsonObject = JSON.parse(jsonText);       

//var jsonObject = eval("(" + jsonText + ")");

alert(jsonObject.user[0].Gender);

//---- alert gives [object Object]

//------- value of jsonText is

"[ { "user": [ { "Gender": "M", "Minage": "28", "Maxage": "24", "MaritalStatusId": "2,3", "ChildrenPreferencesId": "0", "PersonalValueId": "1", "MinHeight": "6", "MaxHeight": "1", "BodyTypeId": "0", "ComplexionId": "0", "HealthAttributeId": "1", "SpecialCaseId": "1", "ReligionId": "3,5", "CasteId": "1,6", "MotherTongueId": "", "QualificationLevelId": "2,3", "QualificationFieldId": "", "WorkingWithId": "4,5", "ProfessionArea": "3,4", "WorkingAsId": "3,4", "IncomeId": "3", "DietId": "0", "SmokeId": "1", "DrinkId": "2", "CountryId": "4,5", "ResidencyId": "", "PartnerDescription": "" }] } ]"
  • 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-05-27T10:18:08+00:00Added an answer on May 27, 2026 at 10:18 am

    Your JSON object itself is an array:

    alert( jsonObject[0].user[0].Gender );
    

    See an example at http://jsfiddle.net/GTLX3/

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

Sidebar

Related Questions

For the first time I am using ajax with asp.net. There for I am
I am using JSON for first time... and want to fill my datagrid with
I'm using ASP.NET 4.0, jquery and json (very like mvc) and getting a hard
I am playing around with ASP.NET MVC for the first time, so I apologize
i'm building an MVC3 site and using Knockout / JSON for the first time,
I have a JSON data object and a text/html javascript template written using the
I parse data using JSON in javascript, I find this is very convenient. But
I cant find one way to get this value (comment) into json using javascript.
I'm using the combination of json_encode (PHP) and JSON.parser (Javascript from json.org) for passing
I am developing some client side Javascript that is using some JSON web services

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.