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

  • Home
  • SEARCH
  • 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 7090695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:05:15+00:00 2026-05-28T08:05:15+00:00

I have a fairly simple data audit web application written with ASP MVC which

  • 0

I have a fairly simple data audit web application written with ASP MVC which effectively has two views of the same model for different purposes.

  1. Agent view – The form filled out by the person validating information the information. Each field on the form in this view has 3 subfields:

    a. Original Value – The value from the database before the call was made

    b. New Value – The value provided by the person on the phone if it differs from the original.

    c. Action – A general indication of what happened

  2. QC View – The form filled out by someone who reviews the work performed in Agent view. Each field on the form in this view has 5 subfields:

    a. Original Value – Same as above

    b. Agent Value – The value provided in 1b above by the agent.

    c. QC Value – The corrected “New Value” if the value specified by the agent is incorrect.

    d. Agent Action – Same as above, except read only in this view

    e. QC Action – The corrected “New Action” if improperly chosen by the agent.

The only differences between the two views are the subfields available. I’d like to be able to use a single view to represent both views since the overall structure of the pages is identical, and just use HTML helpers to handle the differences in subfields. What I have so far are 2 distinctly separate series of helpers (currently in the same class though could be separated):

// Agent controls
public static MvcHtmlString AuditControl(this HtmlHelper htmlHelper, string id, string fieldLabel, MvcHtmlString editControl, string cssClass)
public static MvcHtmlString AuditControl(this HtmlHelper htmlHelper, string id, string fieldLabel, string editControl, string cssClass)
public static MvcHtmlString AuditControl<COMPLEX>(this HtmlHelper htmlHelper, string id, string fieldLabel, string cssClass) where COMPLEX : AbstractComplex, new()

// QC controls
public static MvcHtmlString ReviewControl(this HtmlHelper htmlHelper, string id, string fieldLabel, MvcHtmlString editControl, string cssClass)
public static MvcHtmlString ReviewControl(this HtmlHelper htmlHelper, string id, string fieldLabel, string editControl, string cssClass)
public static MvcHtmlString ReviewControl<COMPLEX>(this HtmlHelper htmlHelper, string id, string fieldLabel, string cssClass) where COMPLEX : AbstractComplex, new()

Where the third implementations handle the more complex fields composed of multiple pieces of data (like Full name, Address, etc).

One possible solution that I’ve considered is to separate the different types of controls into different classes which implement a common interface and then pass them as type parameters to more generic HTML helpers. I think this would work but then I’d somehow need to be able to tell the view which implementation it should use to draw the view, which seems problematic because it seems to blur the line between View and Controller.

One less appealing approach that seems obvious is to pass a sort of admin flag from the controller which would be used by a generic (in logic not meaning type generic) factory helper and build the logic in it to know which series of methods to use. This would keep the model and view separate, but feels dirty because then the HTML helper would become responsible for more than just building the HTML.

Is this a reasonable situation to break the separation of concerns as designed by MVC or is there a more appropriate solution?

  • 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-28T08:05:15+00:00Added an answer on May 28, 2026 at 8:05 am

    Since you are using MVC3, I would recommend using child actions for the sub fields:

    http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx

    Child actions allow you to execute an action on a controller inside of your view, this would be a much cleaner approach.

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

Sidebar

Related Questions

I have a fairly simple android app, it gets protobuf data from a web
I have a fairly simple application using Core Data, and a couple Array Controllers
I have a number of objects which are fairly simple data style classes with
I have a following fairly simple scenario: Some data needs to be written into
I have a fairly simple ASP.NET 2.0 menu control using a sitemap file and
I have a fairly simple set of functionality for which I have multiple implementations,
I have a Core Data app with a fairly simple data model. I want
I have a fairly simple requirement for a query API which I need to
I have a fairly simple Action in an MVC3 application that should render an
I have a fairly simple table (forgive errors / stupidity, I'm still learning. Written

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.