SixString Posted January 21, 2004 Posted January 21, 2004 Hi ;) I have a ReadOnly Multiline TextBox that has DataBound Text and i wat it to have a limit of characters at runtime and i just cant get it to have maximum value for the characters that i specify Can anyone Help please Quote
samsmithnz Posted January 21, 2004 Posted January 21, 2004 have you set the MaxLength property of the textbox? Quote Thanks Sam http://www.samsmith.co.nz
SixString Posted January 21, 2004 Author Posted January 21, 2004 Yes i did ...but since its databound text ..it dosent respect it i guess Quote
Administrators PlausiblyDamp Posted January 21, 2004 Administrators Posted January 21, 2004 If it's readonly and databound couldn't you limit the amount of text it's binding to? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
samsmithnz Posted January 21, 2004 Posted January 21, 2004 or truncate the text as you read it in? Quote Thanks Sam http://www.samsmith.co.nz
SixString Posted January 21, 2004 Author Posted January 21, 2004 the concept its something like this I have a text : "See Forum Rules (below) for more information about what codes you are allowed to use in your posts." thats the Text from the database now at runtime i want it to be like this : "See Forum Rules (below) for more information about what codes..." im shure that must be way to manage that Thanks Quote
AugustB Posted January 23, 2004 Posted January 23, 2004 Best practice would be to truncate the text in a database stored procedure. That solves the problem you have, and also sends less data across the network. Quote
*Gurus* Derek Stone Posted January 25, 2004 *Gurus* Posted January 25, 2004 And if that doesn't work create a function to handle it: Public Function TruncateText(ByVal text As String, ByVal maximumLength As Integer) As String If text.Length > maximumLength Then Return text.Substring(0, maximumLength) & "..." Else Return text End If End Function Quote Posting Guidelines
SixString Posted January 26, 2004 Author Posted January 26, 2004 Thanks so much for the help :) Thats just what i need Cheers Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.