How can I check to see if a Model(MVC) is valid?
Hello Group,
I am trying to check to see if a model is valid(without errors) when the page loads. Using VB.NET is there a way of doing this?
Also, I am trying to do this in the .ascx page... i only see for the modelstate methods of Equals and referenceequals....
Here is the code I using which doesnt work...
<%
If
ChampionTrees.Common.Models.PersonIndicator.Owner
And
Len(LTrim(RTrim(Html.Encode(Model.LastName)))) < 1
And
_ Len(LTrim(RTrim(Html.Encode(Model.FirstName)))) > 1
And
ModelState.Equals(
True
,
True
)
Then
%>
thanks in advance
Lee