© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
7 replies
SuperBrain

Blazor Server, Bootstrap modal, dismiss after validation

In my Blazor Server app, I have a page that's used to add/edit database records (using EF, of course). I would like to add a
modal
modal
for add/edit actions, but I need it to only dismiss (close) after all validations have passed.

By default, buttons in modal don't dismiss it automatically unless you add
data-bs-dismiss="modal"
data-bs-dismiss="modal"
to them, so my question is - how would I perform certain action on button click and only dismiss the modal after all validations have passed?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Blazor Modal Service
C#CC# / help
3y ago
Blazor validation - validation message not added?
C#CC# / help
2y ago
Blazor JS Interop - Bootstrap 5 Tooltip
C#CC# / help
3y ago
Blazor Server
C#CC# / help
2y ago