Re: how to get the conents of editor on server side

  •  04-27-2010, 1:45 PM

    Re: how to get the conents of editor on server side

    Dear,
     
    Please save the following content to GetContent.aspx,
     
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="GetContent.aspx.vb" Inherits="test_Default" %>
    <%@ Register assembly="CuteEditor" namespace="CuteEditor" tagprefix="CE" %>
    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
    <html>
        <head>
            <title>Test Page </title>    
        </head>
        <body>
            <form id="Form1" runat="server">
                <table cellpadding="15">
                    <tr>
                        <td>
                            <h1>Edit Static Html</h1>        
                            This example demonstrates you can use Cute Editor to edit static html page. Below is an example page that displays a document held in an HTML file on the hard drive. When you submit the form, the document is saved back to the drive. <a href="document.htm"><b>Check the document.htm</b></a>
                            <br />
                            <CE:Editor id="Editor1" AllowPasteHtml="false" runat="server" ></CE:Editor><BR>
                            <asp:Button id="btnUpdate" onclick="Submit" Runat="server" Text="Submit"></asp:Button><br />            
                            <asp:textbox id="textbox1" runat="server" TextMode="MultiLine" Height="250px" Width="750px" Font-Name="Arial"></asp:TextBox>                            
                        
                        </td>
                    </tr>
                </table>            
            </form>
        </body>
    </html>

     
    Save the following content to GetContent.aspx.vb
     

    Partial Class test_Default
        Inherits System.Web.UI.Page
        Public Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

            If Page.IsPostBack Then
                textbox1.Text = Editor1.Text
            Else
            End If
        End Sub
        Public Sub Submit(ByVal sender As Object, ByVal e As System.EventArgs)
            textbox1.Text = Editor1.Text
        End Sub
    End Class
     
    You can run GetContent.aspx, it works.
     
    Regards,
    Eric
     
     
     
View Complete Thread