Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Cute Editor for .NET
»
Re: How do I display a value (text) in the editor on page load? I'm a newbie...please help!
Re: How do I display a value (text) in the editor on page load? I'm a newbie...please help!
05-19-2009, 8:30 PM
bthor10
Joined on 05-18-2009
Posts 4
Re: How do I display a value (text) in the editor on page load? I'm a newbie...please help!
Reply
Quote
<%@ Register TagPrefix=
"CE"
Namespace
=
"CuteEditor"
Assembly
=
"CuteEditor"
%>
<%@ Page Title=
""
Language=
"c#"
AutoEventWireup=
"false"
MasterPageFile=
"~/MasterPages/Admin.Master"
CodeBehind=
"admin_edit_content.aspx.vb"
Inherits
=
"millelacssite.admin_edit_content"
%>
<asp:Content ID=
"Content1"
ContentPlaceHolderID=
"head"
runat=
"server"
>
</asp:Content>
<asp:Content ID=
"Content2"
ContentPlaceHolderID=
"ContentPlaceHolder1"
runat=
"server"
>
<script language=
"JavaScript"
type=
"text/javascript"
>
//Need to figure out how to display value in editor!!!
// get the cute editor instance
//var editor2 = document.getElementById(
'<%=Editor2.ClientID%>');
//
Get
the editor HTML
//document.getElementById(
"<%=Editor2.ClientID%>"
).value =
'hello there';
//editor1.getHTML();
// get the cute editor instance
//var editor2 = document.getElementById(
'<%=Editor2.ClientID%>');
//
Set
the editor
//editor2.setHTML(document.getElementById(
"<%=Editor2.ClientID%>"
).value);
</script>
<script runat=
"server"
>
protected void Page_Load( object sender, EventArgs e )
{
if ( Page.IsPostBack )
return;
//
Set
the startup editor value.
Editor2.Text =
"<p>This is some <strong>sample text</strong>. You are using <a href=\"http://www.fckeditor.net/\">FCKeditor</a>.</p>"
;
}
</script>
<div id=
"content"
>
<h1>Website Content</h1>
<p>You are editing >> (page name here)</p>
<form id=
"Form2"
runat=
"server"
>
<%--display cute editor with less toolbar options--%>
<!--the editor will be displayed with the page content from the
"content"
table for the appropriate page,
page id will be grabbed using get method through page link on admin_website_content.aspx,
ex: admin_edit_content.aspx?pageid=1 is the link to edit the homepage-->
<CE:Editor
ConfigurationPath=
"~/CuteSoft_Client/CuteEditor/Configuration/AutoConfigure/simple.config"
id=
"Editor2"
runat=
"server"
>
</CE:Editor>
<br />
<input id=
"Submit1"
type=
"submit"
value=
"Submit"
runat=
"server"
/>
</form>
</div><!--end content-->
</asp:Content>
View Complete Thread