I have a problem with setting validation message. i have two Model in one control and both Model have same property "amount".
So setting validation for one Model.amount will reflect to other Model.amount as well. I have tried to pass different ids to both but not working.
<%= Html.TextBox("amount", Model.amount, new { id = "Pamount" })%>
<%=Html.ValidationMessage("Pamount", " ")%>
<%= Html.TextBox("amount", Model.amount, new { id = "Eamount" })%>
<%=Html.ValidationMessage("Eamount", " ")%>
and in action I am setting
if (obj.amount.ToString() == "0")
modalState.AddModelError("Pamount", "");
but the validation is applied to Eamount as well
What should I do?