Re: referencing cutesoft Editor from pageName.aspx.cs

  •  10-15-2010, 9:47 AM

    Re: referencing cutesoft Editor from pageName.aspx.cs

    Dear Yazar,
     
    Please refer to the following code:
     
    PutCodeDifferentFile.aspx:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="PutCodeDifferentFile.aspx.cs" Inherits="PutCodeDifferentFile" %>
    <%@ Register assembly="CuteEditor" namespace="CuteEditor" tagprefix="CE" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>    
            <CE:Editor ID="Editor1" runat="server">
            </CE:Editor>
         <asp:Button id="btnUpdate" onclick="Submit" Runat="server" Text="Show HTML"></asp:Button>
          <asp:Literal ID="Literal1" Runat="server" />
        </div>
        </form>
    </body>
    </html>
     
    PutCodeDifferentFile.aspx.cs
    using System;
    using System.Collections.Generic;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    public partial class PutCodeDifferentFile : System.Web.UI.Page
    {
        void Page_Load(object sender, System.EventArgs e)
      {
         if (IsPostBack)
      {
       Literal1.Text = "<h2>The HTML you typed is...</h2><br>";
       Literal1.Text += Server.HtmlEncode(Editor1.Text);
         }
      else
      {
    //   Editor1.Text = "Type Here";
       Editor1.Text = @"<table cellspacing=""4"" cellpadding=""4"" bgcolor=""#ffffff"" border=""0""> <tbody> <tr> <td> <p> <img src=""http://cutesoft.net/Uploads/j0262681.jpg"" width=""80"" alt=""""/></p></td> <td> <p>When your algorithmic and programming skills have reached a level which you cannot improve any further, refining your team strategy will give you that extra edge you need to reach the top. We practiced programming contests with different team members and strategies for many years, and saw a lot of other teams do so too.  </p></td></tr> <tr> <td> <p>  <img src=""http://cutesoft.net/Uploads/PH02366J.jpg"" width=""80"" alt="""" /></p></td> <td> <p>From this we developed a theory about how an optimal team should behave during a contest. However, a refined strategy is not a must: The World Champions of 1995, Freiburg University, were a rookie team, and the winners of the 1994 Northwestern European Contest, Warsaw University, met only two weeks before that contest.  </p></td></tr></tbody></table> <br /> <br />";
      }  
     }
     public void Submit(object sender, System.EventArgs e)
     {
      Literal1.Text = "<h2>The HTML you typed is...</h2><br>";
      Literal1.Text += Server.HtmlEncode(Editor1.Text);
     }
    }
    Thank you for asking
View Complete Thread