views:

255

answers:

2

Im using

modelstate.Adderror("test","test message")

And how can i get this modelstate value in controller itself.

Like I need to get the error message of "test" in the controller.

A: 

Try <%=Html.ValidationMessage("Test") %>.

çağdaş
+2  A: 

He asks for in the controller, I cannot verify this but I think this is simply something like:

ModelState["test"].Value
ModelState["test"].Error
ModelState["test"]

One of those above.

bastijn
ya thanks, this what i exactly looking for..
santose
@santose, in which case - accept the answer pls
David Archer