Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Maxlength property prevents input
Message
 
To
15/10/2007 18:57:35
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01260900
Message ID:
01261181
Views:
9
Hi Bonnie, Eric.
Field is Char(150) but setting the MaxLength to zero gets rid of spaces , whereas if I have maxlength set to anything other than zero, I must delete the spaces.

Is this normal behaviour of Maxlength ? .
Regards,
Gerard



>Hi Gerard,
>
>>Does the MaxLength property determeinw whether the field is filled with spaces ?
>
>No. It's how your column is defined in your database. As Eric said, if it's CHAR(20), it will be pre-filled with 20 spaces when you get the data back from the database. If it's VARCHAR(20), it won't be pre-filled with spaces.
>
>~~Bonnie
>
>
>
>>Hi Eric. Thanks for your reply.
>>
>>Does the MaxLength property determeinw whether the field is filled with spaces ?
>>
>>Regards,
>>Gerard
>>
>>
>>
>>>If your field is defined with the CHAR datatype, it is completly filled with spaces and you need to delete them before entering new characters.
>>>
>>>You should use VARCHAR fields or TRIM them before binding them to the control.
>>>
>>>
>>>>Hi. I have a TextBox control on a Wb Form , and have set a it's MaxLength property to the no. of characters in th database.
>>>>When I try to enter data into the text box, the cursor does not move. I have to keep my finger down on the delete key for a few seconds...its as if the control is padded out with spaces, perhaps up to the maxlength, and until I delete these, it does not let me enter any data.
>>>>
>>>>If I take off the MaLength propery (i.i. set i to zero) I can enter data fine.
>>>>
>>>>Anybody got any ideas whats going on here ?
>>>>regards,
>>>>Gerard
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform