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...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
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...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.