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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T02:31:26+00:00 2026-06-19T02:31:26+00:00

Is possible to Deserialize just a fragment of JSON using JavaScriptSerializer ? I don’t

  • 0

Is possible to Deserialize just a fragment of JSON using JavaScriptSerializer? I don’t need all data from JSON, just a section.

The JSON data look like this:

// **** snip ****
{
    "response":  {
        some data
    }
},
"forecast":  {
    "txt_forecast":  {
    "date": "7:00 AM PST",
    "forecastday":  [ // <-- section needed
        {
            some data....
        },
        .........
        {
            some data....
        }
    ]
},
"simpleforecast":  {
    "forecastday":  [
        more data
    ]
}
// **** snip ****

This is part I need to parse:

"forecastday":  [ // <-- section needed
    {
        some data....
    },
    .........
    {
        some data....
    }
]

I tried with forecast object ( fragment of whole data ), but it returns null.

var jsonData = new WebClient().DownloadString(url);
JavaScriptSerializer ser = new JavaScriptSerializer();
forecast_class forecast = ser.Deserialize<forecast_class>(jsonData);
  • 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-19T02:31:28+00:00Added an answer on June 19, 2026 at 2:31 am

    Will something like this work for you

    var dictObj = new JavaScriptSerializer().Deserialize<Dictionary<string, object>>(jsonData);
    var jsonNew = new JavaScriptSerializer().Serialize(dictObj["forcast"]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to deserialize this json using JSON.NET? players: { 0: { success:
Is it possible to deserialize an enum from an int in c#. e.g. If
Possible Duplicate: How to XML deserialize an object of Unknown Type? I've just started
I am trying to deserialize a rather complex POJOs JSON, where I would need
Using Protobuf-Net, I see that it does not seem possible to deserialize a class
I need to deserialize the following Json, which according to Jsonlint.com is valid, but
I have been using jackson to deserialize successfully json objects and arrays, but this
I am using an API that returns a json object that I need to
I'm trying to pass data to my controller using Ajax and JSON. I've got
Is it possible to serialize and deserialize a class in C++? I've been using

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.