title: How to retrieve a property value from modelstate
body: <p>How can I retrieve a property value from modelstate in httppost action. </p>
  
  <p>Below is the code, I used to retrive the hidden id field from modelstate. But is it not possible to have strongly typed version to get value. Like, if property name is modified, prompting a compile time error.</p>
  
  <p>Could anyone please explain difference between "AttemptedValue" and "RawValue". </p>
  
  <hr>
  
  <pre><code> ModelState state;      
   if (ModelState.TryGetValue("id", out state))
   {
       string value = state.Value.AttemptedValue.ToString();
   }
  </code></pre>