How can I retrieve a property value from modelstate in httppost action.
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.
Could anyone please explain difference between "AttemptedValue" and "RawValue".
ModelState state;
if (ModelState.TryGetValue("id", out state))
{
string value = state.Value.AttemptedValue.ToString();
}