Question

I'm 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.

Was it helpful?

Solution

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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top