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 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 ;
	
		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.
			if ( Page.IsPostBack )
				return ;

			eSubmittedDataBlock.Visible = false ;
		}

		#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);

			// 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);
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    
		}
		#endregion

		private void btnSubmit_ServerClick(object sender, System.EventArgs e)
		{
			eSubmittedDataBlock.Visible = true ;
			txtSubmitted.Value = HttpUtility.HtmlEncode( MyCustomControl.GetFCKeditorValue() ) ;
		}
	}
}
