ASP.NET 1.0 and 1.1 BasicsASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Ok, forgive me if this is something basic. I have the stuff below. It works. What I don't like is that if I enter a value that matches both conditions it displays both error messages. Personally, in that situation, I would rather it just display the first one. How could I go about making that happen?
Thanks,
Jerry
<%-- This stuff is displayed for user interaction --%>
Go to page: <asp:TextBox Runat="server" name="txtPage" ID="txtPage" Width="50" /> <asp:Button Runat=server ID="btnGo" Name="btnGo" Text="Go" /> Page <asp:Label ID="lblCurrentPage" Runat=server /> of <asp:Label ID="lblTotal" Runat=server /> <br>
<%-- Here are the validators --%>
<asp:CompareValidator runat="server" id="compPrimeNumber"
Operator="DataTypeCheck" Type="Integer"
Display="Dynamic" ControlToValidate="txtPage"
ErrorMessage = "You must enter an integer value." />
<asp:CompareValidator runat="server" id="compPrimeNumberPositive"
Operator="GreaterThan" Type="Integer"
Display="Dynamic" ValueToCompare="0"
ControlToValidate="txtPage"
ErrorMessage = "You must enter a value greater than zero." />