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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:40:54+00:00 2026-05-20T03:40:54+00:00

I am doing some work with .Net 4, MVC 3 and jQuery v1.5 I

  • 0

I am doing some work with .Net 4, MVC 3 and jQuery v1.5

I have a JSON object that can change depending on which page is calling it. I’d like to pass the object to a controller.

{ id: 1, title: "Some text", category: "test" }

I understand that if I create a custom model such as

[Serializable]
public class myObject
{
    public int id { get; set; }
    public string title { get; set; }
    public string category { get; set; }
}

and use this in my controller such as

public void DoSomething(myObject data)
{
    // do something
}

and pass the object using jQuery’s .ajax method like this:

$.ajax({ 
    type: "POST", 
    url: "/controller/method", 
    myjsonobject,  
    dataType: "json", 
    traditional: true
});

This works fine, my JSON object is mapped to my C# object. What I’d like to do is pass through a JSON object that’s likely to change. When it changes I don’t want to have to add items to my C# model each time the JSON object changes.

Is this actually possible? I tried mapping objects to a Dictionary but the value of data would just end up being null.

Thanks

  • 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-20T03:40:54+00:00Added an answer on May 20, 2026 at 3:40 am

    Presumably the action that accepts input is only used for this particular purpose so you could just use the FormCollection object and then all your json properties of your object will be added to the string collection.

    [HttpPost]
    public JsonResult JsonAction(FormCollection collection)
    {
        string id = collection["id"];
        return this.Json(null);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm coming from a Rails background and doing some work on a ASP.NET project
I am doing some work on a web site that has a secure area
I have a project I am doing some maintenance work on and have got
After doing some work with Ruby, Rails, and RSpec last summer and I learned
I'm looking at doing some work (for fun) in a compiled language to run
I am new to C# and am doing some work in an existing application.
I've been given the task of doing some work customizing an artist's space in
I'm doing some research work into content aggregators, and I'm curious how some of
I am doing some TTF work for MOSA (the correlating body between all the
I'm doing some funky authentication work (and yes, I know, open-id is awesome, but

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.