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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:45:33+00:00 2026-05-25T23:45:33+00:00

What is a good approach in ASP.NET MVC for implementing a complex form where

  • 0

What is a good approach in ASP.NET MVC for implementing a complex form where sections of the form are shown and hidden based on a user’s inputs?

My background is in Webforms. I am frequently asked to build forms where a user selects an option from a dropdown list, triggering a handful of new fields to appear. A different selection might cause a different set of fields to appear.

In the past, I would handle this scenario via an UpdatePanel and a wrapper Panel around the fields that I want to show or hide. Validation is automatically disabled when the fields are hidden.

Going forward, I’d like to make use of MVC’s attribute-based model validation, but is it possible to make the validation conditional on the values of other properties?

Also, how can I handle the toggling of blocks of form fields? I know how to do it manually in jQuery, but I’m hoping there’s an approach that ties in with validation and server-side code.

I am liking MVC much better overall, but I haven’t figured out how to handle this type of scenario very well. Likely I just need to shift my thinking to fit better with the MVC approach.

  • 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-25T23:45:34+00:00Added an answer on May 25, 2026 at 11:45 pm

    Josh,

    The first thing I’s suggest is to make sure you use ViewModels for the pages that are mode complicated. A ViewModel is basically a Model you create for a specific View; for example, a ViewModel could be a composition of other classes.

    As for dynamically changing the fields on your View, the best way is to use jQuery (or any other javascript library) to do it.

    I also migrated from a web form environment and I know is difficult to change gears at the begining, but trust me, doing a simple jQuery even handler is much simpler than having to put in place a control panel and then the event handlers.

    Not to mention that is much more efficient; update panels are after all making partial posts to the page, sometimes, with jQuery you don’t even need to do that.

    After a few projects with MVC, I actually now find it time consuming to go and do the Update Panels on web forms 😉

    Hope this helps,
    -Covo

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

Sidebar

Related Questions

I am developing an application which is web-based (asp.net MVC). The user configures reminders
A controller in my ASP.NET MVC application pre-populates form data displayed by my view
I'm using ASP.NET MVC and I'd like all user entered string fields to be
Using ASP.NET MVC, I've implemented an autocomplete textbox using the approach very similar to
I'm implementing a simple session cart for unauthenticated users in ASP.NET MVC and I
Good day! I use ASP.NET MVC 2.0 with server validation (DataAnnotations + IDataErrorInfo for
Good day, I have a ASP.net MVC app that needs to upload files to
Is there a recommended approach for injecting Http/Request/Controller context in an ASP.NET MVC application?
I've written some custom model binders (implementing IModelBinder) in our ASP.NET MVC application. I'm
I'm writting an ASP.NET MVC e-commerce app using NHibernate and I want the end-user

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.