Click here to Skip to main content
15,917,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to get text of textbox that has htmleditore extender?
When m simply assigning value of extender textbox, its giving html code, but i want formated text that had formatted with htmleditor extender.
Posted
Comments
DaveAuld 11-Nov-11 12:02pm    
Are you wanting to get formated text at the server side or the client side?

1 solution

Hi,

The following cod works fine for me
C#
txtCopy.Text = Regex.Replace(txtTest.Text, "<.*?>", string.Empty);//to get plain text wihtout html tags
Label1.Text = txtTest.Text;//to get formatted text
 
Share this answer
 
v2
Comments
sriman.ch 16-Nov-11 0:07am    
If you want to copy formatted text to another text box then you have to use ajax html editor sanitizer which is available from codeplex community. Hope this helps.
GaganjyotK 16-Nov-11 0:54am    
ya..i have use this.but this is not working for formatted text like bold,background color,foreground color of text.Regex.Replace(txtTest.Text, "<.*?>", string.Empty),this displays simply a text without any added style.
sriman.ch 16-Nov-11 1:25am    
When you are assigning formatted text to another textbox it will give you the html text and if again try to add then it will throw you an wrror. To overcome this make use of sanitizer and try....Happy Coding
sriman.ch 16-Nov-11 1:26am    
I am unable to add screenshot but when I am assigning the formatted text to label its working fine....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900