Author: loki_l77 | Posted on: 6/20/2008 1:10:13 PM | Views : 511

Hi

I have a textbox control that displays and allows edit to it and has a maxlength attribute defined in it. -- <asp:textbox .... MaxLength="10" >  

I have a comparevalidator that checks for the above textbox for type=integer. The actual data that is stored in the database is nchar(10) in Sql server 2005.  -- <asp:comparevalidator id="cvt" runat="server" controltovalidate="textbox" errormessage="failed" type="Integer" operator="datatypecheck" >

Problem : Everytime the page is posted back with the textbox with 10 integers in it, the comparevalidator fails and Page.isvalid is false. Whereas when the data is posted back with 9 integers or less it works without any problems.

I have tried couple of things but it does not work. I could have created a function and with CustomValidator would have checked, but the ques ...

Go to the complete details ...