pamela rizk
asked on
AJaxControl toolkit html editor
dear All
i have an ajax html editor (editor1) i need to read its content and put it in an asp textbox (textbox1)
but for example if i wrote in the ajax html editor in bold
the content of the textbox will be textbox1.text = editor1.content
and since the content of the editor has the below format :<p><b>test</b></p>
the textbox will display the editor content the output is incorrect
how to solve it?
i have an ajax html editor (editor1) i need to read its content and put it in an asp textbox (textbox1)
but for example if i wrote in the ajax html editor in bold
the content of the textbox will be textbox1.text = editor1.content
and since the content of the editor has the below format :<p><b>test</b></p>
the textbox will display the editor content the output is incorrect
how to solve it?
Where did you get the control?
You will need to encode the HTML content when set value for the textbox:
See reference here.
textbox1.Text = HttpUtility.HtmlEncode(editor1.Content);
See reference here.
ASKER
dear Duy
the content of teh editor is :"<p>sddsd</p>" & vbCrLf & "<p>sdsd<br />" & vbCrLf & "</p>"
HttpUtility.HtmlEncode(edi tor1.Conte nt); = "<p>sddsd</p>
<p>sdsd<br />
</p>"
textbox1.text ="<p>sddsd</p>
<p>sdsd<br />
</p>' which is incorrect
the content of teh editor is :"<p>sddsd</p>" & vbCrLf & "<p>sdsd<br />" & vbCrLf & "</p>"
HttpUtility.HtmlEncode(edi
<p>sdsd<br />
</p>"
textbox1.text ="<p>sddsd</p>
<p>sdsd<br />
</p>' which is incorrect
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
this is tested successfully