0
Answer

MVC compare

karthik v

karthik v

12y
1.6k
1
hi experts i am trying to compare two validation messages on my view in mvc2 framework.

this is what i am trying to use ....


 <%if( Html.ValidationMessageFor(xx => xx.prefix)!= Html.ValidationMessageFor(xx => xx.Number))
 { %>
 <%= Html.ValidationMessageFor(xx => xx.Number)%>
  <%}%>

The above code need to perform when the two validation messages are same but it does not do so in the above comparison..

The above code works when i convert both the html.validationmessagefor(xx=>xx.prefix).tostring()

But it breaks when the user inputs the expected value because there will not be any validation error..

Any ideas?

Your help is greatly appreciated...