Copied to clipboard

Flag this post as spam?

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


  • Chris Ainsley 5 posts 25 karma points
    Jan 27, 2011 @ 11:56
    Chris Ainsley
    0

    user control template area in macro

    Is it possible to have a user control based macro in a content page text area that includes a template area? An example of the standard .NET code is below.

    User Control:

    <%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ucExpand.ascx.vb" Inherits="YouBuildYearbooks.ucExpand" %>

    <div class="divInstructions">

        <div id="divExpand<%=ID %>" class="divExpand"><%= Expand %></div>

        <div id="divExpanded<%=ID %>" class="divExpanded">

            <asp:PlaceHolder runat="server" ID="phExpanded"></asp:PlaceHolder>

        </div>

        <script type="text/javascript">contract('<%= ID %>');</script>

    </div>

    Usage:

        <yb:ucExpand id="ucExpand1" runat="server" Expand="Question here?">
            <ExpandTemplate>
                <p>
                    bla bla bla
                </p>
            </ExpandTemplate>        
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 28, 2011 @ 21:38
    Jan Skovgaard
    0

    Hi Chris

    What is it exactly you're thinking of achieving and what is your idea with the usage code? Is it something you want to use in the Masterpage, based on data from the user control?

    Please tell a bit more about what you're trying to achieve then I think it will be easier to answer. And maybe what you're trying to do can be done in a more efficient manner :)

    /Jan

  • Chris Ainsley 5 posts 25 karma points
    Jan 31, 2011 @ 09:51
    Chris Ainsley
    0

    I am attempting to put a user control into a rich text editor through a macro. I am attempting to determine whether it is possible to use a templated user control.

    It is possible to do this a different way, but i just want to see if this is possible for evaluation purposes.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 31, 2011 @ 10:08
    Jan Skovgaard
    0

    Hi Chris

    Well, I can't see why it should not be possible. But maybe I'm missing something. But you should be able to use the user control without problems in Umbraco I think.

    When you have created the user control make sure that you upload both the .ascx file to the user control folder and the assembly (if any is created) to the bin folder.

    /Jan

  • Chris Ainsley 5 posts 25 karma points
    Jan 31, 2011 @ 10:10
    Chris Ainsley
    0

    Yes i have used user controls with no problems, but I do not see a way of entering custom content inside of the user control through a template like in the code above.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 31, 2011 @ 10:13
    Jan Skovgaard
    0

    Hi Chris

    You should be able to create some parameters on your macro, which can be used to pass content to your user control. What kind of content are you thinking about? Just textstrings or content from RTE fields?

    /Jan

  • Chris Ainsley 5 posts 25 karma points
    Jan 31, 2011 @ 14:22
    Chris Ainsley
    0

    I have used parameters, but the ExpandTemplate parameter doesn't render on the page.

  • Chris Ainsley 5 posts 25 karma points
    Jan 31, 2011 @ 17:59
    Chris Ainsley
    0

    I setup parameters by removing the template, but now i have the problem of passing html as a parameter for the .net user control, the html is closed as text. any ideas?

Please Sign in or register to post replies

Write your reply to:

Draft