Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I am creating a Surface controller for the member login. I was just wandering what I should use for passing the validation message to the view.
What's the difference and what's best practice here?
THanx,
IDsert
The easies way is to use attributes on the models properties for the validation. The modelstate the automatically adds the invalidation message. Anyway when doing it directly, use the "ModelState.AddModelError(...)" method.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
TempData.Add or ModelState.AddModelError to pass "Invalid username or password"
Hi,
I am creating a Surface controller for the member login. I was just wandering what I should use for passing the validation message to the view.
What's the difference and what's best practice here?
THanx,
IDsert
The easies way is to use attributes on the models properties for the validation. The modelstate the automatically adds the invalidation message. Anyway when doing it directly, use the "ModelState.AddModelError(...)" method.
is working on a reply...