[Mono-bugs] [Bug 343730] New: Compare and Range validators does not work

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Nov 22 19:07:52 EST 2007


https://bugzilla.novell.com/show_bug.cgi?id=343730

           Summary: Compare and Range validators does not work
           Product: Mono: Class Libraries
           Version: 1.2.5
          Platform: i386
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: daniel.soto2k at gmail.com
         QAContact: mono-bugs at ximian.com
          Found By: DeveloperNet


Description of Problem:

The comparevalidator always returns false in Page.IsValid.
The rangevalidator launches an exception

HTTP 500. System.Web.HttpException: Minimum value cannot be converterd
to type Integer

Steps to reproduce the problem:
1. Create an asp.net page
2. Add a Button, a textbox, a compare validator, a range validator, in tree
different cases:

2.1 With compare validator, comparing to another control

<asp:TextBox runat="server" id="Textbox_1" visible="false" text="0"/>
<asp:TextBox class="caja_texto" ID="txtTest" runat="server"
ReadOnly="true" Width="115px">0</ asp:TextBox>
<asp:comparevalidator runat="server" id="comp1"
controltovalidate="txtTest" controltocompare="0"
operation="GreaterThan" type="Integer" errormessage="You must enter a
value greater than zero" display ="dynamic"
validationgroup="Grp1">(*)</ asp:comparevalidator>

2.2 With compare validator, comparing to a value

<asp:TextBox class="caja_texto" ID="txtTest" runat="server"
ReadOnly="true" Width="115px">0</ asp:TextBox>
<asp:comparevalidator runat="server" id="comp1"
controltovalidate="txtTest" valuetocompare="0"
operation="GreaterThan" type="Integer" errormessage="You must enter a
value greater than zero" display ="dynamic"
validationgroup="Grp1">(*)</ asp:comparevalidator>

2.3 With range validator

<asp:TextBox class="caja_texto" ID="txtTest" runat="server"
ReadOnly="true" Width="115px">0</ asp:TextBox>
<asp:rangevalidator runat="server" id="comp1"
controltovalidate="txtTest" minvalue="0" maxvalue="100"
type="Integer" errormessage="You must enter a
value between 0 and 100" display ="dynamic"
validationgroup="Grp1">(*)</ asp:rangevalidator>

3. Add the following code in button click method

Page.Validate("Grp1");

if (Page.IsValid)
   Response.Write("Success!");
else
   Response.Write("Failed");

4. Type the value "50" in the tree cases.

Actual Results:
With comparevalidator, the validation always returns false. With range
validator, an exception

HTTP 500. System.Web.HttpException: Minimum value cannot be converterd
to type Integer

Expected Results:
In the tree cases, the string "Success" because they pass the validation. If
you type value "-1", appears the error messages, because -1 is out of range ,
and is less than zero.

How often does this happen? 
When using compare and range validators. The other validators works fine.

Additional Information:
None.

Best regards.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list