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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:31:07+00:00 2026-05-13T13:31:07+00:00

i see that asp.net mvc 2 has strongly typed helped and looking initially at

  • 0

i see that asp.net mvc 2 has strongly typed helped and looking initially at the way it works i think maybe i am doing something wrong in asp.net mvc 1 in terms of data binding to render the view and post back to the controller.

I often have different objects for rendering the view and posting back to the controller. is this wrong ?? It seems natural as when rendering the view you often have a viewmodel that has lists for dropdowns, etc. but for your posting you only want the properties that are needed to post back.

for example, on the way in for rendering, my viewmodel might look like this

 public class PersonViewModel
 {
      public int Age;
      public string FIrst;
      public JobCategory[] JobCategories;
      public Sport[] Sports;
      public int NumberOfChildren;

 }

in this case, jobCategories and Sports is going to be used to populate a dropdown box. NumberOfchildren is going to just be html put in and i dont want it editable. When i want to post i only want to pass back a slim object with just the posted properties so i have another object

  public class PersonUpdater
 {
      public int Age;
      public string FIrst;
      public int JobCategoryId;
 }

these are the only properties that i need to pass back so my controller will look like this:

 public ActionResult Update(PersonUpdater personUpdater)
 {
      _repository.UpdateModel(personUpdater). 
 }

so, given the above, assuming the strongly typed helper methods (below) seem useful for the way in but then may cause issues on posting back to the server if you are referrring to different properties.

http://weblogs.asp.net/scottgu/archive/2010/01/10/asp-net-mvc-2-strongly-typed-html-helpers.aspx

any thoughts?

  • 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-13T13:31:07+00:00Added an answer on May 13, 2026 at 1:31 pm

    Real problem is – current accepted approach ignores SRP for view models a bit – edit form acts as input and output simultaneously.

    People haven’t accepted yet dividing view model into, as i call them, input view model and output view model (for many – even creating view model layer is too much). Therefore – Mvc2 currently lacks support for this (you aren’t supposed to have strongly typed view that’s not input and output at the same time) mainly because of vagueness and lack of broadly accepted approaches.

    But i do think that there’s a gain (ok… it’s actually a trade off) in going deeper and separating view model into 2 of them. And i won’t be surprised if this idea will evolve and eventually become widely accepted.

    Actually – current approach even has a name – Thunderdome principle. And if guys like Jeremy D. Miller says this is correct, community won’t bother and won’t search for anything else.


    From practical point of view – some of the issues you can mitigate through providing correct metadata (you might want to check out fluent model metadata provider).

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

Sidebar

Related Questions

i see that the codeplex site has moved to asp.net mvc version 2 already.
I have ASP.NET MVC application that has list with jQuery Selectable list. My problem
I really don't think this has anything to do with ASP.NET MVC 2 itself,
I realize that ASP.NET MVC has all the hype. I have my doubts that
So I have an ASP.NET MVC web application that has a silverlight application embedded
In some ASP.NET examples i see that events are used with delegates like this
I put the AdSense script in my asp.net web site code. I see that
What's the purpose of the Content/Themes/base directory in an ASP.NET MVC application? I see
I have an ASP.NET MVC 3 app that is using SQL Server CE 4.0
I'm building an ASP.NET MVC 2 site that uses LINQ to SQL. In one

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.