<asp:TextBox ID="txtDescricao" runat="server" TextMode="MultiLine" Rows="5"
Width="100%" Height="100%"></asp:TextBox>
<asp:RequiredFieldValidator SetFocusOnError="True" runat="server"
ControlToValidate="txtDescricao" ValidationGroup="SalvarNoticia">
</asp:RequiredFieldValidator>
<ajaxtoolkit:HtmlEditorExtender runat="server" ID="heeDescricao"
TargetControlID="txtDescricao" DisplaySourceTab="true" EnableSanitization="false"
OnImageUploadComplete="heeDescricao_ImageUploadComplete">
<Toolbar>
...
<ajaxtoolkit:InsertImage />
...
</Toolbar>
</ajaxtoolkit:HtmlEditorExtender>
On another page I separated a HtmlEditorExtender
to demonstrate the content of the text.
So I did like this:
<asp:Panel ID="pnlDescricao" SkinID="PanelMain" runat="server" Height="70px">
<div id="txtDescricao" runat="server">
</div>
</asp:Panel>
And in the Code-Behind of this demo page I return the text this way:
var obj = new Business.Texto().Obter(id);
if (obj != null)
{
...
txtDescricao.InnerHtml = obj.Descricao;
...
}
I'm using SQL Server and saved the content in a field of type text , and I load it to a property of type <div>
.
The screen renders the html code, not the image itself:
Example:
Andthehtmlsourcewheninspectingtheitemappearslikethis:
<div id="CPHConsultaBody_pnlDescricao"
class="ui-widget ui-widget-content ui-corner-all"
style="height:70px;padding:2px;margin-top:2px;padding:5px;">
<div id="CPHConsultaBody_txtDescricao">
<imgsrc="/Arquivos/temp/20140603091536649/wall-smiley.jpg"></div>
</div>
How can I resolve this problem?