© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
27 replies
XD

❔ Show error text message under update text box through server validation without refreshing

So basically I want to show an error text message if the user updates and submits an invalid value, but in my code when the user submits a wrong value the page will refresh, the update textbox will be hid again (it's hidden unless the user presses an update button) and the error message will be displayed in two textboxes.

Is my only solution implementing client-side validation for my update textbox?

My code:

Index.cshtml: https://pastebin.com/EhWcWBxC
HomeController: https://pastebin.com/rB9q3Uiv
TodoModel: https://pastebin.com/SjW0Mben
111111.PNG
22222222.PNG
Pastebin
@model Models.ViewModels.TodoViewModel@{ ViewData["Title"] = "To...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
using Microsoft.AspNetCore.Mvc;using Models;using System.Diagnostic...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
using System.ComponentModel.DataAnnotations;namespace Models{ pu...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

basic rpg help, update text box
C#CC# / help
3y ago
message box
C#CC# / help
3y ago
Razor Page Validation Error Message
C#CC# / help
2y ago
✅ Avalonia Message Box
C#CC# / help
11mo ago