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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:06:04+00:00 2026-05-25T11:06:04+00:00

In my MVC3 application, I have a view model that I Json encode so

  • 0

In my MVC3 application, I have a view model that I Json encode so I can manipulate it in JavaScript.

So let’s say I have the following code:

var model=@Html.Raw(Json.Encode(Model));

Currently, model.Name has value “Name”.

What I want to do now is create another JavaScript object “obj” that has a field called “Value”. When you change obj.Value, it also changes model.Name.

So I want something like:

var obj=new Object();
obj.Value=model.Name;

So right now, if I change the value of obj.Value, it doesn’t also change model.Name. I want that to happen and I’m not sure how I can do it in JavaScript. How do I do implement that?

  • 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-25T11:06:04+00:00Added an answer on May 25, 2026 at 11:06 am

    Why don’t just just put the name in a hidden input field. Change the value with whatever JavaScript you choose in the usual way. Then when the form is posted back you can bind to the name value in the controller action, and set the Model name server-side.

    What you are attempting is unnecessarily complicated.

    If you really wanted to make it work – then on submit put the entire JSON string in a hidden input field. Then again in the controller action bind to the JSON as a string and deserialize it server-side to reconstruct your Model.

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

Sidebar

Related Questions

I have an MVC3 application with Razor and I created a View that inside
I want to have one model & view that is served by multiple controllers
I have develop small Asp.net MVC3 application using Telerik rad Controls with in that
I have a View in my MVC3 application which displays one of two pretty
I have lots of forms in my MVC3 application that require the user to
I am working on a .Net MVC3 application. I have a couple different models
I have a model which contains a link to sql query that fetches information
We have a ASP.NET MVC 3 application that uses unobtrusive jQuery validation. The page
I have an MVC3 application using NHibernate. I've created my own membership and role
I have been developing an application in asp.net mvc3. We have used models to

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.