<asp:RequiredFieldValidator
ID="ReqdMaxPrice" runat="server"
ErrorMessage="Maximum price not entered"
ControlToValidate="txtMaxPrice" SetFocusOnError=true
EnableClientScript="False" InitialValue="1">"*"
</asp:RequiredFieldValidator>
Do more with
<asp:RegularExpressionValidator id="RegularExpressionValidator" runat="server" ErrorMessage="Invalid number. Must be between 0 and 99." InitialValue="" Display="Dynamic" ControlToValidate="txtMaxPrice" ValidationExpression="^\d{1,2}$">Invalid number</asp:RegularExpressionValidator>
<asp:TextBox ID="txtMaxPrice" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Please enter price." ControlToValidate="txtMaxPrice"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valMaxPrice" runat="server"
ErrorMessage="The Maximum Price needs to be numeric"
ValidationExpression="^\d{0,2}(\.\d{1,2})?$"
ControlToValidate="txtMaxPrice" SetFocusOnError="true" >
</asp:RegularExpressionValidator>
<asp:Button ID="Button1" runat="server" Text="Button" />
Premium Content
You need an Expert Office subscription to comment.Start Free Trial