hello friends,
in one my application i want to show content of html page without showing of its tag.
For exmple
dim str as string
str="<table><tr><td>asdf</td></tr></table>"
textbox1.text=str
then i want on textbox only show asdf not display tag.
It is possible on page using response.write()
but i want it on textbox so i can edit the content of html.
how it is possible.
Plz help me Thanks in advance
Sandeep
Its not possible to show the html content in Textbox unless you have to use some thirdparty controls like
Freetextbox, FCKEditor.net , TinyMCE Editor control
for Freetextbox.com
www.fckeditor.net
Best you can use TinyMCE Editor control its fully javascript based
actually i solved this problem.I wanted to show some text with HTML tags in textbox.buts with encoding it shows only text,HTML tags are not applied.For Label control HTML tags works properly.Textbox is multiline and label control is Not multiline.So i made
Label control Multiline and its work like Textbox with proper HTML Format.Below is the code:
Label lbl=new Label();
lbl.Text="<b>My Page</b>"
lblread.Text = lbl.Text.Replace(
Environment.NewLine,
"<BR/>");//this line of code makes label
sandeep_sury...
Member
66 Points
25 Posts
how to display html content on textbox
Oct 11, 2006 08:57 AM|LINK
hello friends,
in one my application i want to show content of html page without showing of its tag.
For exmple
dim str as string
str="<table><tr><td>asdf</td></tr></table>"
textbox1.text=str
then i want on textbox only show asdf not display tag.
It is possible on page using response.write()
but i want it on textbox so i can edit the content of html.
how it is possible.
Plz help me Thanks in advance
Sandeep
Jasson_King
Star
8057 Points
1520 Posts
Re: how to display html content on textbox
Oct 11, 2006 09:12 AM|LINK
You would need to create a custom textbox which can show complex HTML content to do that. Or, you could use WebBrowser control instead.
satish_nagde...
Contributor
6572 Points
1432 Posts
Re: how to display html content on textbox
Oct 11, 2006 09:17 AM|LINK
hi sandeep
check this might be useful for you.
http://www.standardio.org/article.aspx?id=193 - there's mistake i think instead of htmldecode htmlencode is used.
play around i think you should get the answere.
regards,
satish
sandeep_sury...
Member
66 Points
25 Posts
Re: how to display html content on textbox
Oct 11, 2006 11:56 AM|LINK
hello sir,
Thanks for reply. Its very easy to write html content on page using response.write() method.
But i want to edit the html content, so it is not possible on page control for that purpose it is only textbox useful.
So sir plz send me sample code how to display html content on textbox without html tag.
Thanks,
Sandeep R. Suryawanshi
satish_nagde...
Contributor
6572 Points
1432 Posts
Re: how to display html content on textbox
Oct 11, 2006 12:50 PM|LINK
hi sandeep,
you can write this way
text1.text = Server.HtmlDecode(your html text)
regards,
satish
mounir
Member
15 Points
3 Posts
Re: how to display html content on textbox
Oct 11, 2006 02:13 PM|LINK
hi sandeep
in textBox you can't display without tag.
you must display use any other control for exemple : label.
then with this control (label) you can test your code it will be functionnal without Server.HtmlDecode
[;)]
rahulmandhar...
Member
4 Points
5 Posts
Re: how to display html content on textbox
May 09, 2009 04:29 AM|LINK
venkatu2005
All-Star
32487 Points
6742 Posts
Re: how to display html content on textbox
May 09, 2009 04:39 AM|LINK
Its not possible to show the html content in Textbox unless you have to use some thirdparty controls like Freetextbox, FCKEditor.net , TinyMCE Editor control
for Freetextbox.com
www.fckeditor.net
Best you can use TinyMCE Editor control its fully javascript based
Thanks.
smartymca
Member
78 Points
188 Posts
how to display html content on textbox
May 09, 2009 04:48 AM|LINK
Have u tried encoded format
Pune,India
rahulmandhar...
Member
4 Points
5 Posts
Re: how to display html content on textbox
May 09, 2009 11:46 AM|LINK
actually i solved this problem.I wanted to show some text with HTML tags in textbox.buts with encoding it shows only text,HTML tags are not applied.For Label control HTML tags works properly.Textbox is multiline and label control is Not multiline.So i made Label control Multiline and its work like Textbox with proper HTML Format.Below is the code:
Label lbl=new Label();
lbl.Text="<b>My Page</b>"
lblread.Text = lbl.Text.Replace(
Environment.NewLine, "<BR/>");//this line of code makes label// control multilene[:D]
Now u can use label as a rich textbox in asp.net
reply me rahulmandhare1@gmail.com
Now my label shows particular text in bold format also as multiline.Check it.