This project is read-only.

User Control Error

Topics: Controls
May 4, 2009 at 5:27 AM

Someone else posted here with this probelm late last year and it was apparently never resolved so I am starting a new thread.

When I follow the instructions given in the User Control Injection video and run the site on localhost (Visual Studio builtin server) all is well. Move it to the live server and we get this error:

ERROR - UNABLE TO LOAD CONTROL : ~/User controls/test.ascx

The markup duplicates what was given in the video:     [usercontrol:~/User controls/test.ascx]   other than that we are not in the root folder (it doesn't work there either btw)  and test.ascx has exactly the same code as in the video. It sort of felt like a permissions problem but as far as I can tell all is well there.

Anyone with a solution?

While I am at it.. the reason we started this is that I wanted to include an IFRAME in some of my posts and for whatever reason TinyMCE refuses to let it survive after entry via the HTML editor.

If anyone has a solution to /that/ problem we can stop worrying about the other one at least for now...
May 4, 2009 at 7:25 AM
Hopefully you're on BE 1.5 since it has the newer tinyMce editor (the old one is pretty old).  In either event, in the tinyMCE.ascx file in the admin folder, there's a tinyMCE.init() function call with a lot of parameters in there.  You can tell tinyMCE to allow an <iframe> tag via the "extended_valid_elements" property.  I added that below and seems to do the trick (the part I added is in bold).  You can add more tags to extended_valid_elements also if needed.  I believe it's a pipe delimited list.

    // General options
    mode: "exact",
    elements : "<%=txtContent.ClientID %>",
    theme: "advanced",
    plugins : "inlinepopups,fullscreen,contextmenu,emotions,table,iespell,advlink",
    convert_urls: false,
  // Theme options
    theme_advanced_buttons1: "fullscreen,code,|,cut,copy,paste,|,undo,redo,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,outdent,indent,|,iespell,link,unlink,sub,sup,removeformat,cleanup,charmap,emotions,|,formatselect,fontselect,fontsizeselect",
    theme_advanced_buttons2: "",
    theme_advanced_toolbar_location: "top",
    theme_advanced_toolbar_align: "left",
    theme_advanced_statusbar_location: "bottom",
    theme_advanced_resizing: true,
    extended_valid_elements: "iframe",
    tab_focus : ":prev,:next"
May 4, 2009 at 7:22 PM

Thanks that should do it!