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

    Re: How do I display a value (text) in the editor on page load? I'm a newbie...please help!

    1. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>    
    2.   
    3. <%@ Page Title="" Language="c#" AutoEventWireup="false" MasterPageFile="~/MasterPages/Admin.Master" CodeBehind="admin_edit_content.aspx.vb" Inherits="millelacssite.admin_edit_content" %>  
    4. <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">  
    5. </asp:Content>  
    6. <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">  
    7.   
    8. <script language="JavaScript" type="text/javascript" >  
    9.   
    10.         //Need to figure out how to display value in editor!!!  
    11.           
    12.                 // get the cute editor instance  
    13.                 //var editor2 = document.getElementById('<%=Editor2.ClientID%>');  
    14.                   
    15.                 // Get the editor HTML  
    16.                 //document.getElementById("<%=Editor2.ClientID%>").value = 'hello there';  
    17.                   
    18.                 //editor1.getHTML();  
    19.                   
    20.           
    21.                 // get the cute editor instance  
    22.                 //var editor2 = document.getElementById('<%=Editor2.ClientID%>');  
    23.                   
    24.                 // Set the editor  
    25.                 //editor2.setHTML(document.getElementById("<%=Editor2.ClientID%>").value);  
    26. </script>  
    27.   
    28. <script runat="server">  
    29. protected void Page_Load( object sender, EventArgs e )  
    30.     {  
    31.         if ( Page.IsPostBack )  
    32.             return;  
    33.   
    34.         // Set the startup editor value.  
    35.         Editor2.Text = "<p>This is some <strong>sample text</strong>. You are using <a href=\"http://www.fckeditor.net/\">FCKeditor</a>.</p>";  
    36.     }  
    37. </script>  
    38.   
    39.   
    40.   
    41.   
    42.   
    43. <div id="content">  
    44.     <h1>Website Content</h1>  
    45.     <p>You are editing >> (page name here)</p>  
    46.       
    47.      <form id="Form2" runat="server">  
    48.           
    49.         <%--display cute editor with less toolbar options--%>  
    50.           
    51.         <!--the editor will be displayed with the page content from the "content" table for the appropriate page,  
    52.             page id will be grabbed using get method through page link on admin_website_content.aspx,  
    53.             ex: admin_edit_content.aspx?pageid=1 is the link to edit the homepage-->  
    54.               
    55.         <CE:Editor   
    56.             ConfigurationPath="~/CuteSoft_Client/CuteEditor/Configuration/AutoConfigure/simple.config"  
    57.             id="Editor2"   
    58.             runat="server">  
    59.         </CE:Editor>  
    60.         <br />  
    61.     
    62.           
    63.         <input id="Submit1" type="submit" value="Submit" runat="server" />  
    64.           
    65.      </form>  
    66. </div><!--end content-->  
    67.   
    68. </asp:Content> 

     
     
View Complete Thread