---
title: "How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?"  
description: "How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?"  
author: "marcel ethan"  
published: 2013-05-29  
updated: 2013-05-29  
canonical: https://www.mindstick.com/forum/927/how-can-i-deserialize-json-to-a-simple-dictionary-string-string-in-asp-dot-net  
category: "json"  
tags: ["json"]  
reading_time: 1 minute  

---

# How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?

Hi Everyone!\
I have a simple key/value list in JSON being sent back to ASP.NET via POST. Example:\
{ "key1": "value1", "key2": "value2"}I AM NOT TRYING TO DESERIALIZE INTO STRONGLY-TYPED .NET OBJECTS\
I simply need a plain old [Dictionary](https://www.mindstick.com/articles/1500/hashtable-and-dictionary-in-c-sharp)(Of String, String), or some equivalent ([hash table](https://www.mindstick.com/interview/23440/what-is-hash-table), Dictionary(Of String, Object), old-school StringDictionary--hell, a 2-D [array of strings](https://www.mindstick.com/forum/158840/create-a-rust-program-to-sort-an-array-of-strings-in-lexicographical-order) would work for me.\
I can use anything available in ASP.NET 3.5, [as well as](https://www.mindstick.com/interview/2481/can-you-write-a-java-class-that-could-be-used-both-as-an-applet-as-well-as-an-application) the popular Json.NET (which I'm already using for [serialization](https://www.mindstick.com/articles/11917/serialization-in-java) to the client).\
Apparently neither of these JSON [libraries](https://answers.mindstick.com/qa/49244/which-company-is-ahead-in-classification-of-data-for-libraries-innovations) have this forehead-slapping obvious capability out of the box--they are totally focused on [reflection](https://www.mindstick.com/articles/13004/how-to-write-a-reflection-paper)-based [deserialization](https://www.mindstick.com/interview/2462/what-is-deserialization) via strong contracts.Any ideas?\
[Limitations](https://www.mindstick.com/interview/121/what-are-the-benefits-and-limitations-of-using-hidden-fields):\
I don't want to implement my own JSON parserCan't use ASP.NET 4.0 yetWould prefer to stay away from the older, [deprecated](https://www.mindstick.com/forum/972/deprecated-as-a-property-in-sencha-touch) ASP.NET class for JSON\
Thanks in advance!\

## Replies

### Reply by AVADHESH PATEL

Hi Marcel!\
Json.NET does this...\
string json = @"{""key1"":""value1"",""key2"":""value2""}";\
Dictionary<string, string> values = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);\


---

Original Source: https://www.mindstick.com/forum/927/how-can-i-deserialize-json-to-a-simple-dictionary-string-string-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
