title: Pattern for ASP.NET MVC View Hide/Unhide Controls
body: <p>I am looking for a POEAA</p>
  
  <p>I have a standard ASP.NET MVC View with tons of input controls. The visibility of the controls is triggered based on inputs from 2 main dropdown controls. for e.g. DropDown1 with value A and DropDown2 with value B will show only few controls from the full list and will also change the mandatory requirements. </p>
  
  <p>How should I design the view? </p>
  
  <ol>
  <li><p>Write java script and hide/unhide based on the DropDown combinations.There can be 30 combinations so might be challenging to manage on new controls and combinations</p></li>
  <li><p>Create a table in database that will give a list of control ids for each combination and then on client side loop through it to hide/unhide?</p></li>
  <li><p>Any other patterns someone can suggest? Aim is to keep it clean and manageable</p></li>
  </ol>
  
  <p><strong>Real World Example</strong></p>
  
  <p>Working on a property listing form. Based on the selected property type and transction type, the controls are hidden/shown. </p>
  
  <p>For e.g. Bedrooms and Bathrooms do not apply to a Plot/Land. There are 2 dozen such controls whose visibility needs to be managed based on the property type/transaction type comibination. </p>
  
  <p>The list can grow...</p>
  
  <p>Thanks,
  Pinakin</p>