Kamil
Kamil

Reputation: 149

TinyMCE Asp.NET 4 Icons missing

I have problem with TinyMCE. I work in web forms. Icons on client environment are missing. On my local machine everything is OK. I use the newest version of TinyMCE which is 4.0.2. On server there is IIS 7.0. I have setup this for many different ways. I have also tried put editor in <head> section. Effect is always the same. It is my current implementation:

 public static string GetTinyMce4JS(string path, string control, int width, int height, bool enableXmlEncoding = false)
    {
        StringBuilder sb = new StringBuilder();
        sb.Append(string.Format("<script src=\"{0}tinymce/js/tinymce/tinymce.min.js\" type=\"text/javascript\"></script>", path));

        sb.Append("<script type=\"text/javascript\">");
        sb.Append("tinymce.init({");
        sb.Append("selector : \".tinymce\",");         
        sb.Append("theme : \"modern\",");

        sb.Append(" menubar: false,");

        sb.Append("plugins : [ \"lists hr anchor pagebreak\",");
        sb.Append("\"wordcount visualblocks visualchars \",");
        sb.Append("\"insertdatetime nonbreaking directionality\",");
        sb.Append("\"paste textcolor moxiemanager\"],");


        sb.Append("toolbar1: \"newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect\",");
        sb.Append("toolbar2: \"cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image media code | inserttime preview | forecolor backcolor\",");
        sb.Append("toolbar3: \"table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft\",");      
        sb.Append("});");
        sb.Append("</script>");
        return sb.ToString();
    }

Then I use this function in code behind (invoke on Page_Load):

string tinyJS = ApplicationHelper.GetTinyMce4JS(ResolveUrl("~"), this.TinyMCEEditor.ClientID, 800, 600, false);
this.TinyMCEJS.Text = tinyJS;

And the aspx file:

  <asp:Literal ID="TinyMCEJS" runat="server" />
  <asp:TextBox ID="TinyMCEEditor" runat="server" TextMode="MultiLine" Height="600px" ClientIDMode="Static" CssClass="tinymce" z-index="200"
                        Visible="true"></asp:TextBox>

This is how it looks like on client environment:
enter image description here

And the same on my local machine:

enter image description here

Upvotes: 0

Views: 1134

Answers (1)

Kamil
Kamil

Reputation: 149

I have finally resolved it!! Stupid mistake... I use publish to deploy web application on the server. I have set "Only files needed to run this application" in publish option and this was the reason. Files for Icons were not published.

Upvotes: 2

Related Questions