I have an problem with Validation in .NET
I am using server side validation for a text box, i applied requiredfield and range validator for that. and my issue is i want to display messages in same place instead of using
for both the messages.
suppose i left the textbox it says "it is required" and if i enter some value beyond the range it says "Range must be 1 to 100" but both the messages are in different places which doesn't seems good.
i don't want to use validation summary, i tried "validationGroup" and "Display" property, but i still didn't get the solution.
can anyone have any idea?
<asp:TextBox ID="txtEmpID" runat="server" CssClass ="textbox"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtEmpID" ErrorMessage="Emp ID is Must"
Display ="Dynamic"></asp:RequiredFieldValidator>
<br />
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="txtEmpID" ErrorMessage="Range must be 1 -100"
MaximumValue="100" MinimumValue="1" Type="Integer" Display ="Dynamic"></asp:RangeValidator>