Click here to Skip to main content
16,020,990 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

I am using required field validator for a TextBox.

Is it possible to show error messages in an alert or message box when validation fails?

Please Help me friends by providing some sample.

Thanks in advance.
Posted
Comments
__TR__ 22-Aug-12 9:06am    
Is it a windows application or a web application ?
rahulbhadouria 22-Aug-12 9:14am    
web application

I am assuming that you are asking your question w.r.t ASP.Net. For required field validator, you will need to show the error message in the form itself. It cannot come in alert. If you really need to show alerts, better go for implementing javascript. Check the textbox value on button click or similar and display an alert.
 
Share this answer
 
Comments
rahulbhadouria 22-Aug-12 9:08am    
please show me some code,because I am new to java script.
Please
ValidationSummary[^] has an attribute for that.
 
Share this answer
 
Here is a Sample code[^]

Since you are new to javascript you might find the below links helpful.
http://www.w3schools.com/js/default.asp[^]

Javascript Beginner tutorial[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900