Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

textbox width can not be set while using clienttarget=downlevel

Status
Not open for further replies.

theresatan

Programmer
Mar 18, 2002
101
US
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=&quot;True&quot; Language=&quot;VB&quot; clienttarget=downlevel Debug=&quot;True&quot; %>

<html>

<script runat =&quot;server&quot;>

sub OK_click(sender as object, e as eventargs)
text4.Text = &quot;&quot;
rangeValInteger.Validate()
If (rangeValInteger.IsValid) Then
text4.Text = &quot;Result: Valid!&quot;
Else
text4.Text = &quot;Result: Not Valid!&quot;
End If

end sub
</script>

<body>
<form runat=&quot;server&quot;>
<asp:textbox id=&quot;text1&quot; width = 30px runat=&quot;server&quot; />
<asp:RangeValidator
id=&quot;rangeValInteger&quot;
Type=&quot;Integer&quot;
ControlToValidate=&quot;text1&quot;
MaximumValue=&quot;10&quot;
MinimumValue=&quot;1&quot;
runat=&quot;server&quot;/>

<br>

<asp:textbox id=&quot;text4&quot; runat=&quot;server&quot; /><br>
<asp:button id=&quot;ok&quot; text =&quot;ok&quot; onclick=&quot;OK_click&quot; runat=&quot;server&quot; /><br>
</form>
</body>
</html>

Any idea?

I appreciate your input.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top