Copied to clipboard

Flag this post as spam?

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


  • James Randle 9 posts 71 karma points
    May 17, 2010 @ 15:55
    James Randle
    0

    Using an Umbraco Datatype from within a TinyMCE plugin

    Hi,

    This is my first post, so... hello :0).

     

    I have a Usercontrol registered as a datatype in umbraco. It provides the user with a list of documents based on a search term they provide. It uses a postback to display the data - no AJAX has been neccessary ... yet. That works A-OK.

    My boss has decided that it would be nice for end-users to be able to access the same usercontrol from within a TinyMCE plugin, ultimately allowing them to insert a link to a document into a page they are editing. Fancy stuff!

    I have the TinyMCE button visible and working. I have 'excluded' the .aspx page (that i am using instead of dialog.htm) using <add key="umbracoReservedUrls" ... />.

    Unfortunately, i am having problems with the .aspx page being displayed. As soon as i try to use the Datatype Usercontrol i end up with errors such as ...

    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    Parser Error
    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message: Could not load type 'UK.Gov.AmberValley.testsearch'.

    Source Error:


    Line 1:  <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="testsearch.aspx.cs" Inherits="UK.Gov.AmberValley.testsearch" %>
    Line 2: 
    Line 3:  <%@ Register src="DocLibrarySearch.ascx" tagname="DocLibrarySearch" tagprefix="uc1" %>
     

    Source File: /umbraco_client/tinymce3/plugins/example/testsearch.aspx    Line: 1


    I realise that this is more of a .NET, dll in the bin directory sort of an error, but after 3 days faffing around with every possible combination of namespace, assembly name, Src attribute, etc, etc, I am hoping someone can shine a bit of light on the subject?

     

    Thankyou in advance,

    James.

  • James Randle 9 posts 71 karma points
    May 18, 2010 @ 11:08
    James Randle
    0

    Does everyone hate me or something? I am better looking and clevererer, but answering every other question posted is just plain rude :0).

  • James Randle 9 posts 71 karma points
    May 19, 2010 @ 13:52
    James Randle
    0

    So i managed to find the solution...

    1. Use the original dialog.htm page supplied with the tinymce example.

    2. Place an iframe inside dialog.htm whose href is the aspx page with the usercontrol on it.

    3. change the .aspx <%@ Register src="..." .../> so src contains a relative path to the 'datatype control' in the umbraco usercontrols folder.

    4. update dialog.js so that the init function checks that it is being called from dialog.htm (as it is also called when the iframe loads?!)

     

    Thanks again for all your help.

     

Please Sign in or register to post replies

Write your reply to:

Draft