-
- This is the submitted data:
-
+
+
+
FCKeditor - Sample
+
+
+
+
+
+
+
+
Index: /FCKeditor.Net/trunk/_samples/aspx/1.1/sample03.aspx.cs
===================================================================
--- /FCKeditor.Net/trunk/_samples/aspx/1.1/sample03.aspx.cs (revision 1200)
+++ /FCKeditor.Net/trunk/_samples/aspx/1.1/sample03.aspx.cs (revision 1201)
@@ -12,20 +12,28 @@
namespace FredCK.FCKeditorV2.Samples
{
- public class sample03 : System.Web.UI.Page
+ public class Sample03 : System.Web.UI.Page
{
- protected System.Web.UI.HtmlControls.HtmlInputButton btnSubmit;
- protected System.Web.UI.HtmlControls.HtmlGenericControl eSubmittedDataBlock;
- protected System.Web.UI.HtmlControls.HtmlTextArea txtSubmitted;
-
- protected sample031 MyCustomControl ;
+ protected System.Web.UI.WebControls.DropDownList cmbToolbars;
+ protected FredCK.FCKeditorV2.FCKeditor FCKeditor1;
+ protected System.Web.UI.WebControls.Button BtnSubmit;
+ protected System.Web.UI.WebControls.Label LblPostedData;
+ protected System.Web.UI.HtmlControls.HtmlGenericControl PostedAlertBlock;
+ protected System.Web.UI.HtmlControls.HtmlGenericControl PostedDataBlock;
private void Page_Load(object sender, System.EventArgs e)
{
- // We'll do initializartion only the first time.
- // Once the page is submitted, nothing must be done in the OnLoad.
+ // Set the base path. This is the URL path for the FCKeditor
+ // installations. By default "/fckeditor/".
+ FCKeditor1.BasePath = this.GetBasePath();
+
+ LblPostedData.Text = "";
+ PostedAlertBlock.Visible = false;
+ PostedDataBlock.Visible = false;
+
if ( Page.IsPostBack )
- return ;
+ return;
- eSubmittedDataBlock.Visible = false ;
+ // Set the startup editor value.
+ FCKeditor1.Value = "
This is some sample text . You are using FCKeditor .
";
}
@@ -38,9 +46,4 @@
InitializeComponent();
base.OnInit(e);
-
- // This events declarations has been moved to the "OnInit" method
- // to avoid a bug in Visual Studio to delete then without any advice.
- this.Load += new System.EventHandler(this.Page_Load);
- this.btnSubmit.ServerClick += new System.EventHandler(this.btnSubmit_ServerClick);
}
@@ -51,11 +54,39 @@
private void InitializeComponent()
{
+ this.Load += new System.EventHandler(this.Page_Load);
+
}
#endregion
- private void btnSubmit_ServerClick(object sender, System.EventArgs e)
+ ///
+ /// Automatically calculates the editor base path based on the _samples
+ /// directory. This is usefull only for these samples. A real application
+ /// should use something like this instead:
+ ///
+ /// FCKeditor1.BasePath = "/fckeditor/" ; // "/fckeditor/" is the default value.
+ ///
+ ///
+ private string GetBasePath()
{
- eSubmittedDataBlock.Visible = true ;
- txtSubmitted.Value = HttpUtility.HtmlEncode( MyCustomControl.GetFCKeditorValue() ) ;
+ string path = Request.Url.AbsolutePath;
+ int index = path.LastIndexOf( "_samples" );
+ return path.Remove( index, path.Length - index );
+ }
+
+ protected void BtnSubmit_Click( object sender, EventArgs e )
+ {
+ // For sample purposes, print the editor value at the bottom of the
+ // page. Note that we are encoding the value, so it will be printed as
+ // is, intead of rendering it.
+ LblPostedData.Text = HttpUtility.HtmlEncode( FCKeditor1.Value );
+
+ // Make the posted data block visible.
+ PostedDataBlock.Visible = true;
+ PostedAlertBlock.Visible = true;
+ }
+
+ protected void cmbToolbars_SelectedIndexChanged( object sender, EventArgs e )
+ {
+ FCKeditor1.ToolbarSet = cmbToolbars.SelectedValue;
}
}
Index: /FCKeditor.Net/trunk/_samples/aspx/1.1/sample04.aspx
===================================================================
--- /FCKeditor.Net/trunk/_samples/aspx/1.1/sample04.aspx (revision 1201)
+++ /FCKeditor.Net/trunk/_samples/aspx/1.1/sample04.aspx (revision 1201)
@@ -0,0 +1,81 @@
+<%@ Page language="c#" Codebehind="sample04.aspx.cs" AutoEventWireup="false" Inherits="FredCK.FCKeditorV2.Samples.Sample04" %>
+
+<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
+
+<%--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ * - GNU General Public License Version 2 or later (the "GPL")
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * - Mozilla Public License Version 1.1 or later (the "MPL")
+ * http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * Sample page.
+--%>
+
+
+
FCKeditor - Sample
+
+
+
+
+
+
+
+
+
Index: /FCKeditor.Net/trunk/_samples/aspx/1.1/sample04.aspx.cs
===================================================================
--- /FCKeditor.Net/trunk/_samples/aspx/1.1/sample04.aspx.cs (revision 1201)
+++ /FCKeditor.Net/trunk/_samples/aspx/1.1/sample04.aspx.cs (revision 1201)
@@ -0,0 +1,94 @@
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Web;
+using System.Web.SessionState;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using System.Web.UI.HtmlControls;
+
+namespace FredCK.FCKeditorV2.Samples
+{
+ public class Sample04 : System.Web.UI.Page
+ {
+ protected System.Web.UI.WebControls.DropDownList cmbSkin;
+ protected FredCK.FCKeditorV2.FCKeditor FCKeditor1;
+ protected System.Web.UI.WebControls.Button BtnSubmit;
+ protected System.Web.UI.WebControls.Label LblPostedData;
+ protected System.Web.UI.HtmlControls.HtmlGenericControl PostedAlertBlock;
+ protected System.Web.UI.HtmlControls.HtmlGenericControl PostedDataBlock;
+
+ private void Page_Load(object sender, System.EventArgs e)
+ {
+ // Set the base path. This is the URL path for the FCKeditor
+ // installations. By default "/fckeditor/".
+ FCKeditor1.BasePath = this.GetBasePath();
+
+ LblPostedData.Text = "";
+ PostedAlertBlock.Visible = false;
+ PostedDataBlock.Visible = false;
+
+ if ( Page.IsPostBack )
+ return;
+
+ // Set the startup editor value.
+ FCKeditor1.Value = "
This is some sample text . You are using FCKeditor .
";
+ }
+
+ #region Web Form Designer generated code
+ override protected void OnInit(EventArgs e)
+ {
+ //
+ // CODEGEN: This call is required by the ASP.NET Web Form Designer.
+ //
+ InitializeComponent();
+ base.OnInit(e);
+ }
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.Load += new System.EventHandler(this.Page_Load);
+
+ }
+ #endregion
+
+ ///
+ /// Automatically calculates the editor base path based on the _samples
+ /// directory. This is usefull only for these samples. A real application
+ /// should use something like this instead:
+ ///
+ /// FCKeditor1.BasePath = "/fckeditor/" ; // "/fckeditor/" is the default value.
+ ///
+ ///
+ private string GetBasePath()
+ {
+ string path = Request.Url.AbsolutePath;
+ int index = path.LastIndexOf( "_samples" );
+ return path.Remove( index, path.Length - index );
+ }
+
+ protected void BtnSubmit_Click( object sender, EventArgs e )
+ {
+ // For sample purposes, print the editor value at the bottom of the
+ // page. Note that we are encoding the value, so it will be printed as
+ // is, intead of rendering it.
+ LblPostedData.Text = HttpUtility.HtmlEncode( FCKeditor1.Value );
+
+ // Make the posted data block visible.
+ PostedDataBlock.Visible = true;
+ PostedAlertBlock.Visible = true;
+ }
+
+ protected void cmbSkin_SelectedIndexChanged( object sender, EventArgs e )
+ {
+ // Relative to the "editor" folder in the FCKeditor installation.
+ FCKeditor1.Config["SkinPath"] = this.GetBasePath() + "editor/skins/" + cmbSkin.SelectedValue + "/";
+ }
+ }
+}
Index: Keditor.Net/trunk/_samples/aspx/1.1/sampleposteddata.aspx
===================================================================
--- /FCKeditor.Net/trunk/_samples/aspx/1.1/sampleposteddata.aspx (revision 1200)
+++ (revision )
@@ -1,49 +1,0 @@
-<%@ Page ValidateRequest="false" Language="C#" AutoEventWireup="false" %>
-<%--
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
- *
- * == BEGIN LICENSE ==
- *
- * Licensed under the terms of any of the following licenses at your
- * choice:
- *
- * - GNU General Public License Version 2 or later (the "GPL")
- * http://www.gnu.org/licenses/gpl.html
- *
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
- * http://www.gnu.org/licenses/lgpl.html
- *
- * - Mozilla Public License Version 1.1 or later (the "MPL")
- * http://www.mozilla.org/MPL/MPL-1.1.html
- *
- * == END LICENSE ==
- *
- * This page lists the data posted by a form.
---%>
-
-
-
-
FCKeditor - Samples - Posted Data
-
-
-
-
-
-
FCKeditor - Samples - Posted Data
- This page lists all data posted by the form.
-
-
-
- Field Name
- Value
-
- <% foreach ( string sForm in Request.Form ) { %>
-
- <%=sForm%>
- <%=Server.HtmlEncode( Request.Form[sForm] )%>
-
- <% } %>
-
-
-
Index: /FCKeditor.Net/trunk/_samples/aspx/default.html
===================================================================
--- /FCKeditor.Net/trunk/_samples/aspx/default.html (revision 1201)
+++ /FCKeditor.Net/trunk/_samples/aspx/default.html (revision 1201)
@@ -0,0 +1,32 @@
+
+
+
+
FCKeditor - Sample
+
+
+
+
+
+
+ FCKeditor - ASP.NET - Samples
+
+
+ In the FCKeditor.Net installation package you will find two directories containing
+ examples on how to use FCKeditor in web forms:
+
+ _samples/aspx/1.1 : Samples targetted to the .NET Framework 1.1.
+ _samples/aspx/2.0 : Samples targetted to the .NET Framework 2.0+.
+
+
+ There directories contain the same exact samples, but you will note some diffences
+ in the code, due to the different way the Code Behind is handled by each of the
+ above .NET Framework versions.
+
+ To properly run the samples you must copy one of the above folders to the "_samples "
+ folder in FCKeditor installation in your web server or Visual Studio project. You
+ may eventualy rename the folder to "aspx", just make it clearer.
+
+ Remember to copy also the FredCK.FCKeditorV2.dll file, provide
+ with FCKeditor.Net, in the bin folder of your web site.
+
+