Hello,
I am using the Editor control to allow users to enter HTML content to my page. The Editor is located within a Dialog control and the entered content should be stored on Dialog commands (save and cancel command).
If the editor is opened with empty content, everything works fine - after closing the dialog I can get the content from the HTML property. If old content is placed in the HTML property on startup, the content is changed in the editor and then the dialog's save button is pressed, then no change is visible in the HTML property - it still contains the old value.
Here is my source code:
Quote:
<asp:ImageButton runat="server" ID="btnEdit" OnCommand="dlgEditItem_Command" CommandName="edit" ImageUrl="../../images/action/edit16.gif" ToolTip='edit' />
<eo:Dialog ID="dlgEditItem" runat="server" BackColor="White" Height="300px" Width="400px"
AcceptButton="btnAccept" CancelButton="btnCancelEdit"
AcceptButtonPostBack="true" CancelButtonPostBack="true">
<contenttemplate>
<eo:Editor runat="server" id="editor" visible="false">
</eo:Editor>
</contenttemplate>
<footertemplate>
<asp:Button ID="btnAccept" runat="server" CommandName="save" OnCommand="dlgEditItem_Command"
Text='save' UseSubmitBehavior="true" />
<asp:Button ID="btnCancelEdit" runat="server" CommandName="cancel" OnCommand="dlgEditItem_Command"
Text='cancel' UseSubmitBehavior="true" />
</footertemplate>
</eo:Dialog>
Quote:
private string content;
protected void dlgEditItem_Command(object sender, CommandEventArgs e)
{
switch (e.CommandName)
{
case "edit":
editor.Visible = true;
editor.Html = content;
dlgEditItem.Show();
break;
case "save":
content = editor.Html;
editor.Visible = false;
break;
case "cancel":
editor.Html = content;
editor.Visible = false;
break;
}
}