Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Re: ASP.NET TextBox (http://www.velocityreviews.com/forums/t77438-re-asp-net-textbox.html)

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 &
TextBox1.Text,TextBox1.Text)

Hope this helps,
Garett

http://www.aimx.com
There's no place like 127.0.0.1


"Oliver" <anonymous@discussions.microsoft.com> wrote in message
news:A9513135-6B44-4082-96BD-6B7080906AAC@microsoft.com...
> 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
return.
>
> 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.