Try our conversational search powered by Generative AI!

Use htmleditor on aspx page

Vote:
 

Hi,

I'm creating a custom property. The property opens a new window and in that aspx page I would like to use some episerver properties and save the values from the properties to an xml string.

My plan was to inherit from simplepage and by code add new properties.

   PropertyXhtmlString oEditor = new PropertyXhtmlString();    
oEditor.EditorSettings=EPiServer.SystemControls.EditorOption.All;    
CurrentPage.Property.Add("propertyEditor",oEditor);
 
It works fine but after postback I don't know how to get the value from the editor. 
Maybe i'm doing it totaly wrong?
#20528
Jun 04, 2008 10:27
Vote:
 

I found a way to do it.

Aspx page:

<EPiServer:Property PropertyName="_Editor" id="ctlHtmlEditor"  EditMode="true" runat="server" />

 

Codebehind:

protected EPiServer.WebControls.Property ctlHtmlEditor;

onInit
PropertyXhtmlString oEditor = new PropertyXhtmlString();
oEditor.Name="_Editor";
oEditor.EditorSettings=EPiServer.SystemControls.EditorOption.All;
CurrentPage.Property.Add(oEditor);

On postback
string sHtml = ctlHtmlEditor.PropertyValue as String;

#20547
Edited, Jun 04, 2008 14:36
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.