validating a textbox without using validation control
I have 3 textboxes in my webform.I want my user to enter valid entries into them. If user leaves any textbox empty.I want Give him an alert to him (like a msgbox in vb.net).I'm using textboxes in asp.net(web server controls).I dont want to use the validation controls as they wont give a pop up message.
percent20's coding is not working in the asp.net server.This is the correct code and WHICH IS WORKING ONLY WITH c#Make sure this lable1 is disabled the visible properties in the properties
if (txtField1.Text =="")
{ label1.Visible = true;
}
I have 3 textboxes in my webform.I want my user to enter valid entries into them. If user leaves any textbox empty.I want Give him an alert to him (like a msgbox in vb.net).I'm using textboxes in asp.net(web server controls).I dont want to use the validation controls as they wont give a pop up message.
Hi Rama
You have mentioned a specific reason "they wont give a pop up message" is this the reason why you are not using validation controls?
Validation Control are performed on client side n therefore good user experience, on the other hand you have server side validation which you can write a peiece of code to validate controls . you just have set display="None", which gives you pop up message.