Velocity Reviews

Velocity Reviews (
-   ASP .Net (
-   -   Re: ASP.NET TextBox (

Garett Rogers 05-05-2004 02:55 PM

Re: ASP.NET TextBox
a small workaround that you can try would be to add an extra carriage return
at the beginning of the textbox if one exists already... if you do a little
experiment, adding 2 carriage returns and some text will produce one blank
line, 3 will produce 2, 4 will produce 3, etc.

So here's my solution... In the page load do the following:

TextBox1.Text = IIf(TextBox1.Text.IndexOf(vbCrLf) = 0,vbCrLf &

Hope this helps,
There's no place like

"Oliver" <> wrote in message
> I hope some can help me with a slight problem.
> I have a form with a multi-line text box. The problem I have is when the

user enters a carriage return followed by some text, the form is posted back
and the value of text box is correct. It includes the leading carriage
> However, when the textbox is redisplayed on the client, any leading

carriage returns are lost and need to re-entered each time.
> Any ideas?
> Thanks
> Oliver

=?Utf-8?B?T2xpdmVy?= 05-06-2004 11:51 AM

Re: ASP.NET TextBox
Thanks guys

Using a slightly modified version of your sugguestion Garett, I was able to get it to work. Instead of prefixing the text with an additional CR I used a space. Thus avoiding the need to calcalate the number of additional CRs required

TextBox1.Text = IIf( TextBox1.Text.IndexOf(vbCrLf) = 0, Format("_{0}",TextBox1.Text), TextBox1.Text

All times are GMT. The time now is 04:21 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.