Click here to Skip to main content
15,902,939 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in c# asp.net 2.0 when i did not enter text in textbox and if i move to next textbox it should display error message..how to do that..can anyone help me..
Posted

Hello,
You just write code on text box TextChanged event.

Thanks
Abhimanyu Rawat
 
Share this answer
 
Hi,

you can use RequiredFieldvalidator controls
 
Share this answer
 
v2
Try This[^]

hope it helps :)
 
Share this answer
 
With this example the required field validator is applied on name textbox kindly go through with the answer and then apply it on your project:

<html>
<body>

<form runat="server">
Name: <asp:TextBox id="name" runat="server" />

Age: <asp:TextBox id="age" runat="server" />

<asp:Button runat="server" Text="Submit" />

<asp:RequiredFieldValidator
ControlToValidate="name" Text="The name field is required!" runat="server" />
</form>

</body>
</html>
 
Share this answer
 
IN Asp.net

there is a validation control

Required field validator.

so use that
 
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