C
C#17mo 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
Hackmagician17mo 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
YasirOP17mo ago
can you please explain a little bit more how to do this exactly @hackmagician
Hackmagician
Hackmagician17mo ago
slap ur model in like this
Hackmagician
Hackmagician17mo ago
Hackmagician
Hackmagician17mo ago
then a form like this and those spans for validation under each property u wanna validate so they lign up
Hackmagician
Hackmagician17mo ago
Hackmagician
Hackmagician17mo ago
and then slap a submit one
Hackmagician
Hackmagician17mo ago
and as for the controller
Accord
Accord17mo 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.
Want results from more Discord servers?
Add your server