Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: ASP.NET TextBox

Reply
Thread Tools

Re: ASP.NET TextBox

 
 
Garett Rogers
Guest
Posts: n/a
 
      05-05-2004
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" <> wrote in message
news:A9513135-6B44-4082-96BD-...
> 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



 
Reply With Quote
 
 
 
 
=?Utf-8?B?T2xpdmVy?=
Guest
Posts: n/a
 
      05-06-2004
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rich TextBox / HTML TextBox Jay ASP .Net 5 04-28-2005 11:15 PM
Calendar popup - using ASP textbox instead of HTML textbox =?Utf-8?B?Q2hyaXM=?= ASP .Net 3 03-30-2005 06:02 PM
runat="server"....a simple html textbox or a webform server textbox...that is the question. Hazzard ASP .Net 2 07-23-2003 07:32 AM
Re: runat="server"....a simple html textbox or a webform server textbox...that is the question. Natty Gur ASP .Net 0 07-22-2003 03:57 AM
Re: VERY STRANGE BUG? Adding a textbox control causes other textbox control to fail??? S. Justin Gengo ASP .Net 0 07-16-2003 06:51 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57