theresatan
Programmer
Hi, All,
I need to use RangeValidator controll to validate input.
When I set the page's ClientTarget property to "Downlevel", RangeValidator controll works fine but the width of all textbox controll on that page were reset to default, it make my page looks funny.
When set the page's ClientTarget property to "Upevel', then the width of all textbox controll back to normal but RangeValidator controll did not work.
Follwing is an example:
<%@Page Explicit="True" Language="VB" clienttarget=downlevel Debug="True" %>
<html>
<script runat ="server">
sub OK_click(sender as object, e as eventargs)
text4.Text = ""
rangeValInteger.Validate()
If (rangeValInteger.IsValid) Then
text4.Text = "Result: Valid!"
Else
text4.Text = "Result: Not Valid!"
End If
end sub
</script>
<body>
<form runat="server">
<asp:textbox id="text1" width = 30px runat="server" />
<asp:RangeValidator
id="rangeValInteger"
Type="Integer"
ControlToValidate="text1"
MaximumValue="10"
MinimumValue="1"
runat="server"/>
<br>
<asp:textbox id="text4" runat="server" /><br>
<asp:button id="ok" text ="ok" onclick="OK_click" runat="server" /><br>
</form>
</body>
</html>
Any idea?
I appreciate your input.
I need to use RangeValidator controll to validate input.
When I set the page's ClientTarget property to "Downlevel", RangeValidator controll works fine but the width of all textbox controll on that page were reset to default, it make my page looks funny.
When set the page's ClientTarget property to "Upevel', then the width of all textbox controll back to normal but RangeValidator controll did not work.
Follwing is an example:
<%@Page Explicit="True" Language="VB" clienttarget=downlevel Debug="True" %>
<html>
<script runat ="server">
sub OK_click(sender as object, e as eventargs)
text4.Text = ""
rangeValInteger.Validate()
If (rangeValInteger.IsValid) Then
text4.Text = "Result: Valid!"
Else
text4.Text = "Result: Not Valid!"
End If
end sub
</script>
<body>
<form runat="server">
<asp:textbox id="text1" width = 30px runat="server" />
<asp:RangeValidator
id="rangeValInteger"
Type="Integer"
ControlToValidate="text1"
MaximumValue="10"
MinimumValue="1"
runat="server"/>
<br>
<asp:textbox id="text4" runat="server" /><br>
<asp:button id="ok" text ="ok" onclick="OK_click" runat="server" /><br>
</form>
</body>
</html>
Any idea?
I appreciate your input.