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.
client validation control
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Qty") %>' Width="50px" MaxLength="3" AutoPostBack="True" OnTextChanged="TextBox1_TextChanged"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
runat="server"
ErrorMessage="You must enter Qty"
ValidationGroup="v1"
ControlToValidate="TextBox1" Display="None" SetFocusOnError="true" >
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowSummary="false" ShowMessageBox="true" ValidationGroup="v1" />
Mark as solved if it helps you!!!