Home > how to > how to display error message in label in asp.net

How To Display Error Message In Label In Asp.net

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Asp.net validation error message to change labels text up vote 3 down vote favorite I am using asp.net validation controls for validating user input. What i want is to change the label text with the error message generated by the validation control. Thank you. asp.net validation webforms share|improve this question edited Dec 30 '12 at 1:20 Joe Alfano 6,01941834 asked Dec 29 '12 at 21:43 Raghav 132111 I like the idea, but I'm not sure it can be done using the regular ASP.NET Validation controls. If you are open for solutions using other validation frameworks (such as jQuery Validate, or some other jQuery validation plugin) I could write up an answer on how to do that with your example. –Tomas Lycken Dec 29 '12 at 21:55 Hi @TomasLycken I am new to programming so any suggestion and guideline would be great to learn up.Please do show what you are suggesting Thank you. –Raghav Dec 30 '12 at 18:08 After reading the answers by others, I realize what I had in mind doesn't really fit into the WebForms paradigm - I guess I've been doing ASP.NET MVC for too long :P But there are two good suggestions there for you to try out! –Tomas Lycken Dec 30 '12 at 22:20 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted One way is to handle the submit-button's OnClientClick-event and call a javascript function like:

 

© Copyright 2019|winbytes.org.