Textbox new line entry

Posted by Vanchi050585 under Regular Expressions on 1/5/2011 | Points: 10 | Views : 1992 | Status : [Member] | Replies : 4
Dear all,

if i type the text as in the following format:

input:
---------

Teacher: Do u know abt Raj Jeyanthi?
Student: Jeyanthi is Jappa figure. who is Raj?

note:
--------
then when i retrieve that from the DB that will be displayed like the below output.
output:
---------------
Teacher: Do u know abt Raj Jeyanthi? Student: Jeyanthi is Jappa figure. who is Raj?

note:
---------

but i want to be dispalayed like how i am typing.

Thanks

Thanks
tvn



Responses

Posted by: T.saravanan on: 1/5/2011 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi,

How to show your Text ? Are you using any control ?


Thanks,
T.Saravanan

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: SheoNarayan on: 1/5/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
You should write something like

Literal1.Text = txtBox1.Text.Trim().Replace("\n", "<br />");


Thanks!

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 1/5/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
You can save the input text to the DB as an completely formatted XML with the formatted spaces... so that when retrieving we can get the same format as saved

Thanks
Karthik
www.f5Debug.net

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Suresh.mekkattil on: 1/11/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,
A Literal control or a Label Or a <div runat="server"> could solve your problem

-----
Suresh M

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response