C
C#12mo ago
Yasir

❔ Contact us validation for MVC project

Hi Mates, I have prebuilt Contact Us page in Bootstrap, But I want to use this page for user contact without disturbing the page rendering. and please tell me do I have to use Model(already I have a controller for contact )
9 Replies
Hackmagician
Hackmagician12mo ago
i'd use a model and then have a <div asp-validation-summary="ModelOnly" style="color: rgb(255, 60, 60);"></div> at the start of ur form and <span asp-validation-for="Property" class="text-danger"></span> for each property that u want to validate for
Yasir
Yasir12mo ago
can you please explain a little bit more how to do this exactly @hackmagician
Hackmagician
Hackmagician12mo ago
slap ur model in like this
Hackmagician
Hackmagician12mo ago
Hackmagician
Hackmagician12mo ago
then a form like this and those spans for validation under each property u wanna validate so they lign up
Hackmagician
Hackmagician12mo ago
Hackmagician
Hackmagician12mo ago
and then slap a submit one
Hackmagician
Hackmagician12mo ago
and as for the controller
Accord
Accord12mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.