Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ahmed 1 post 71 karma points
    Mar 15, 2016 @ 13:18
    Ahmed
    0

    RichTextEditor/tinymce

    How to use Datatypes like Richtexteditor in usercontrol or Aspx in Umbraco 7.4 webforms .

    iam trying :

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="productList.aspx.cs" Inherits="CustomModule.BackEnd.productList" MasterPageFile="../masterpages/umbracoPage.Master" %>

    <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>

            <cc1:Pane ID="pn" runat="server">
    
                <%-- Name --%>
                <cc1:PropertyPanel runat="server" Text="Name">
                    <asp:TextBox ID="txtName" runat="server" MaxLength="100" CssClass="guiInputText guiInputStandardSize" />
                </cc1:PropertyPanel>
    
                <%-- Description (html) --%>
                <cc1:PropertyPanel runat="server"  id="panldesc" Text="Description">
                    <asp:PlaceHolder runat="server" ID="phDescription" />
                </cc1:PropertyPanel>
    
            </cc1:Pane>
    
        </cc1:UmbracoPanel>
    
    </cc1:Pane>
    

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using umbraco.cms.businesslogic.datatype; using umbraco.editorControls.tinyMCE3; using umbraco.uicontrols; using Umbraco.Web.UI.Pages;

    namespace CustomModule.BackEnd {

    public partial class productList : UmbracoEnsuredPage
    {
        TinyMCE mceDescription;
        protected override void OnInit(EventArgs e)
        {
            // Save button
            ImageButton save = tabControl.Menu.NewImageButton();
            save.Click += save_Click;
            save.AlternateText = "Save";
            save.ImageUrl = umbraco.GlobalSettings.Path + "/images/editor/save.gif";
    
            // Init TyniMCE for Description
            InitTinyMCE(ref mceDescription, phDescription);
    
        }
    
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //  PutTinyMce(ref mceDescription, "tt", phDescription, upnl);
                // Load your data from db, disk...
                // in this example it is loaded from  the session
                //txtName.Text = (string)UmbracoContext.Current.HttpContext.Session["txtName"];
                //mceDescription.Text = (string)UmbracoContext.Current.HttpContext.Session["mceDescription"];
            }
        }
    
        void save_Click(object sender, ImageClickEventArgs e)
        {
            // Save your data to db, disk...
            // in this example it is saved in the session
            //Umbraco.Web.UmbracoContext.Current.HttpContext.Session["txtName"] = txtName.Text;
            //Umbraco.Web.UmbracoContext.Current.HttpContext.Session["mceDescription"] = mceDescription.Text;
        }
    
        // TODO: move to a generic tools class
        public static void InitTinyMCE(ref TinyMCE control, PlaceHolder ph)
        {
            DataTypeDefinition d = DataTypeDefinition.GetDataTypeDefinition(-87); // -78 = TinyMCE DataType 
            control = (umbraco.editorControls.tinyMCE3.TinyMCE)d.DataType.DataEditor;
            ph.Controls.Add(control);
    
            // Add TinyMCE controls to menu bar
            UmbracoPanel panel = FindParent<UmbracoPanel>(control);
    
            control.ClientIDMode = ClientIDMode.Static;
    
    
            control.config.Add("umbraco_toolbar_id", panel.Menu.ClientID + "_slh");
            panel.Menu.NewElement("div", "umbTinymceMenu_" + control.ClientID, "tinymceMenuBar", 0);
    
        }
    
    
    
    
        // TODO: move to a generic tools class
        public static T FindParent<T>(Control control)
    
            where T : class
        {
            while (control != null)
            {
                control = control.Parent;
                if (control is T)
                {
                    return control as T;
                }
            }
            return null;
        }
    }
    

    }

    it not show it and only found error on console File could not be found "D:\Source Code\NewUmbracoTest\NewUmbracoTest\umbracoclient\tinymce3\plugins\codemirror\editorplugin_src.js", unable to add it for Gzip compression.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Exception: File could not be found "D:\Source Code\NewUmbracoTest\NewUmbracoTest\umbracoclient\tinymce3\plugins\codemirror\editorplugin_src.js", unable to add it for Gzip compression.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [Exception: File could not be found "D:\Source Code\NewUmbracoTest\NewUmbracoTest\umbracoclient\tinymce3\plugins\codemirror\editorpluginsrc.js", unable to add it for Gzip compression.] umbraco.presentation.plugins.tinymce3.GzipCompressor.AddFile(String path) +138 umbraco.presentation.plugins.tinymce3.GzipModule.ProcessRequest(HttpContext context) +2385 umbraco.presentation.plugins.tinymce3.tinymce3tinymceCompress.PageLoad(Object sender, EventArgs e) +38 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51 System.Web.UI.Control.OnLoad(EventArgs e) +95 System.Web.UI.Control.LoadRecursive() +59 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2952

Please Sign in or register to post replies

Write your reply to:

Draft