Tb.text = string What Won't transfer??

T

Tina

In the ItemDataBound event of a datagrid, I am moving data from a varchar
cell into a textbox in a template cell as follows....

mytb.text = e.item.cells(i).text

my problem/question is that this move does not move all characters. For
instance carriage returns and line feeds don't get moved, and some other non
printable characters don't get moved.

Is there any documentation or rule as to what gets moved and what gets
ingored?

Thanks,
T
 
J

Jason Kester

Of course they don't. ASP:TextBox corresponds to <input type=text>.
That's a single line input, so naturally it only takes the first line
that you stick into it.

Try HtmlTextArea (<textarea runat=server>) if you want multiline
input.

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
 
T

Tina

no, it just eliminates the characters and picks back up with following
characters. Effectively it "strips" them
T
 
J

Jason Kester

Same effect as far as you're concerned. Be careful of the ASP:Whatever
tags that have a .Text property. They will invariably reformat your
strings to ensure that it gets HtmlEntityEncoded, and often lead to
wacky behavior like you're seeing.

Did switching to Textareas help?

Jason
 
T

Tina

well, back to my original question...

Is there any documentation or rule as to what gets moved and what gets
ingored?

T
 
M

MasterGaurav

It's not that something will be ignored. Incase, have some "<" / ">",
you'll get a "Potentially dangerous..." exception.

To avoid this, set the property "ValidateRequest = false" in @Page
directive.

See documentation of "@Page directive" for more details.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top