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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:36:27+00:00 2026-05-31T04:36:27+00:00

Here is how I call the method: {email:xxx@hotmail.com,json:{some1:some1, id:1},yyy:yyy} And my method has these

  • 0

Here is how I call the method:

{"email":"xxx@hotmail.com","json":{"some1":"some1", "id":1},"yyy":"yyy"}

And my method has these parameters:

MyMethod(string email, Dictionary<string, object> json, string timestamp){...}

And when I call it with the above mentioned parameters, the method is being called but ‘json’ doesn’t contain nothing. Its count is 0. Why is this happening? How to solve it?

  • 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-31T04:36:29+00:00Added an answer on May 31, 2026 at 4:36 am

    The default JSON serializer does not support this out of the box, however JSON.NET and the System.Web.Script.Serialization.JavaScriptSerializer support this, check the answers to a similar question:
    How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?

    JSON.NET will be the default json serializer for ASP.NET 4.5 WebAPI, so you can expect it to be shipped with ASP.NET + get support from MS for it.

    UPDATE
    In order to let ASP.NET bind the model properly you need a custom model binder:

     public class DictionaryModelBinder : IModelBinder
      {
        public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
          var serializer = new JavaScriptSerializer();
          var value = controllerContext.RequestContext.HttpContext.Request.Form["json"];
          return serializer.Deserialize<Dictionary<string, object>>(HttpUtility.UrlDecode(value));
        }
      }
    

    And add the new model binder to the Application model binders in the Application_Start method:

      protected void Application_Start()
      {          
        ModelBinders.Binders.Add(typeof (Dictionary<string, object>), new DictionaryModelBinder());
        RegisterRoutes(RouteTable.Routes);
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use Fiddler to call my method. Here are the parameters: {timestamp:, json: {
I need to call method for user, which has email parametr. It is function
I use EGORefreshTableHeaderView to update my tableview. Here I call my method to download
I call addNotify() method in class that I posted here. The problem is, that
I use fiddler to call the method which is post. Here is my path:
I'm have some difficulties here, I am unable to successfully call a method which
Here's my ajax call: $.ajax({ url: 'url-to-json', type: 'POST', dataType: 'json', cache: 'false', data:
here I am trying to call overloaded constructor after some condition has met in
Please see the code here: http://pastie.org/1092106 When I call the method createPost on Blog,
I have some code here to call minizip(), a boilerplate dirty renamed main() of

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.