title: How to bind a model dynamically to a view based on user input asp.net mvc 5
body: <p>I am new to mvc I need help to bind a different model to the view from what was originally sent to the view.</p>
  
  <p>Let me explain it further</p>
  
  <p>I have a Model like this</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  
  using System.Text;
  using System.Threading.Tasks;
  using UI.Data.Models.Claim.Shared.CustomerInfo;
  
  namespace UI.Data.Models.Claim
  {
      public abstract class CreateClaimViewmodel 
  {
      public DateTime CreatedDate { get; set; }
      public UserFirstName UFname { get; set; }        
  
      public Customer Customer { get; set; }
     public CustomerAddress CustProvidedAddress { get; set; } 
  
  
      public List&lt;Transactions.Transaction&gt; Transactions { get; set; }
      public DiscrepancyType discreType {get; set;}
       public List&lt;IDiscrepancy&gt; discrepancy  { get; set; } // assumption
  
   }
  </code></pre>
  
  <p>}</p>
  
  <p>I have noted Idiscrepancy as an interface as this might be a different child class based on what the user selects on this view. So when the user selects a discrepancy type from one of the dropdown list values a partial view pops up which has corresponding questions for that discrepancy type. All these discrepancy types point to different Models/ partial views in my application</p>
  
  <pre><code> public enum DiscrepancyType
      {
          WithdrawalError,
          DepositError,
          CancelDetails,
          CanceledServiceSubscTransac,
          DuplicateTransaction,
          ChargedInsteadOfCredit,
          CreditNotReceived,
          DefectiveMerchantdise,
          DifferentAuthorizedAmount,
          GoodsServicesNotReceived,
          MerchandiseReturned,
          NotAsDescribed,
          PaidByAnotherMethod,
          TransacNotRecognized,
          UnauthorizedTransaction, // many more 
  
      }
  </code></pre>
  
  <p>Here comes my question</p>
  
  <p>The part works fine where I want to display a partial view based on the drop down. But I understand now when I post it back to the controller , the new object of type that has been added to the View ( of Idiscrepancy property) based on the users selection from a drop down is not bind to the Model as the Model doesnt exist anymore.  How do I tell my controller that use this new model instead of the Old one ?</p>
  
  <p>I tried using Jquery , but for each partial view I need to write  different jquery code and also create json objects . Is there an efficient way where I can tell my controller that I am posting a view with the same model , but an added object of type  . There are 24 classes of that use/ implement idiscrepancy. </p>
  
  <p>Another option that I thought was using a @model Dynamic , but I am not really sure if that would help my scenario</p>
  
  <p>I understand this is pretty common at many companies and I wonder why there is not much documentation about dynamically changing models based on user input.</p>
  
  <p>Please apologize if my terms are incorrect as I am still trying to get out of webforms thinking.</p>
  
  <p>Thanks in advance!</p>