© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
FluentValidation isn't being used in Razor Page's Model State? - C#
C
C#
•
2y ago
•
1 reply
Memsworth
FluentValidation isn't being used in Razor Page's Model State?
Hello C
#
. Hope things are good
.
I confused as to how to let users see the validation errors
. I have followed
https://docs.fluentvalidation.net/en/latest/aspnet.html
's manual validation method
(the recommended for now
) to validate the model state
.
It states I need to write the validator
-
> inject it to DI
-
> validate in my RazorPage
(cshtml
.cs
) by adding the validationErrors to the model state
.
Here
's how I wrote my validator
:
https://pastebin.com/7ckkZFsK
Here
's how I wrote my form
:
https://pastebin.com/315cqVff
Here
's how I wrote my cshtml
.cs
:
https://pastebin.com/q6cQk7qM
Is it a fault of FluentValidation
? Since I followed how the documentation states to write
. Or am I doing something wrong here
?
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
62,470
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
✅ Debugging razor component page isn`t working
C
C# / help
3y ago
❔ Razor Pages Session for revalidating Page Model
C
C# / help
3y ago
Window opacity isn't being affected?
C
C# / help
4y ago
❔ Page debugging twice in razor pages PageRouteModelConvention
C
C# / help
4y ago