using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; namespace Admin { public class FCKBlock : System.Web.UI.Control, IPostBackDataHandler { public bool LoadPostData(string PostDataKey, System.Collections.Specialized.NameValueCollection postCollection) { string oldValue, postedValue; // Cache the current value of the property oldValue = this.Value; // Get the posted value for the HTML element with the // same ID as the control postedValue = postCollection[PostDataKey]; // Compare the posted value with Value and updates if needed if (oldValue != postedValue) { this.Value = postedValue; return true; } // Indicates whether the state has changed return false; } public void RaisePostDataChangedEvent() { // nothin! } public string Value { get { return (ViewState["Value"] == null ? "" : (string)ViewState["Value"]); } set { ViewState["Value"] = value; } } private int _Width = 350; public int Width { get { return _Width; } set { _Width = value; } } private int _Height = 350; public int Height { get { return _Height; } set { _Height = value; } } private string _ToolbarSet = "WebBlocks"; public string ToolbarSet { get { return _ToolbarSet; } set { _ToolbarSet = value; } } protected override void OnLoad(EventArgs e) { if (!Page.ClientScript.IsClientScriptBlockRegistered("fck")) { Page.ClientScript.RegisterClientScriptBlock(typeof(string), "fck", "", false); } base.OnLoad(e); } protected override void Render(HtmlTextWriter writer) { writer.Write(""); } } }