Connecting Tech Pros Worldwide Help | Site Map

Displaying a horizontal rule in an asp:Textbox

Newbie
 
Join Date: May 2007
Posts: 20
#1: Jul 3 '08
Hi,

I have created a new web application in asp.net.I am using VS 2008.
In the web form,I have placed a textbox and a button.

In the button click event,I have written as follows:

TextBox1.text="abc"+ Environment.NewLine + "<hr>";

I want to get the output as (abc and a horizontalrule in the textbox)
abc
--------------------------------------------------


But I am getting as follows.
abc
<hr>


Please help me regarding this.

Thanks,
Silpa
insertAlias's Avatar
Forum Leader
 
Join Date: Apr 2008
Location: San Antonio, TX (USA)
Posts: 2,608
#2: Jul 3 '08

re: Displaying a horizontal rule in an asp:Textbox


As far as I know text boxes can't display HTML code, just text. If you want something like that, you'll need to use Rich Text.
Needs Regular Fix
 
Join Date: Jul 2006
Location: India,Hyderabad
Posts: 367
#3: Jul 4 '08

re: Displaying a horizontal rule in an asp:Textbox


Hello

Literal control in ASP.net can display line by using <hr> tag,

just use this

Literal1.Text = "ABC" + "<hr>";

hope may solve your problem
Reply