Copied to clipboard

Flag this post as spam?

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


  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Feb 11, 2010 @ 12:22
    Jeroen Breuer
    0

    Macro properties

    Hello,

    I've got a usercontrol which I'm saving as a macro. However I'm not able to call any properties from my usercontrol. Does somebody have a good example? I found this, but it's a bit old. Here is my code perhaps somebody knows what I'm doing wrong.

    public partial class Contact : FormulierUserControl, IDefaultEmailFormProperties
        {
            #region Properties
    
            public string SenderPlaceHolder
            {
                get;
                set;
            }
    
            public string ReceiverPlaceHolder
            {
                get;
                set;
            }
    
            public string CCPlaceHolder
            {
                get;
                set;
            }
    
            public string BCCPlaceHolder
            {
                get;
                set;
            }
    
            #endregion
    }

    When I'm trying to read any of these properties there always null.

  • Richard Soeteman 3875 posts 12037 karma points MVP
    Feb 11, 2010 @ 12:34
    Richard Soeteman
    0

    Hi Jeroen,

    In which event  are you reading the properties? I Guess you should use the Load event and see what happens.

    Cheers,

    Richard

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Feb 11, 2010 @ 12:35
    Thomas Höhler
    0

    Where do you read? in PageLoad or Initialize?

    Did you set up the parameters in the macro? Did you fill in values the Properties?

    I didn't had any problems using properties in an usercontrol

    the syntax seems to be ok

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Feb 11, 2010 @ 12:44
    Jeroen Breuer
    0

    Hmm seems the problem is the value I'm trying to put into the macro:

    This works:

    <umbraco:Macro ReceiverPlaceHolder="test" Alias="[CC]Contact" runat="server"></umbraco:Macro>

    And this doesn't work:

    <umbraco:Macro ReceiverPlaceHolder="[%test%]" Alias="[CC]Contact" runat="server"></umbraco:Macro>

    Does somebody know how I can get it to work with [%%] in the string?

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Feb 11, 2010 @ 12:46
    Thomas Höhler
    0

    try "[&#37;test&#37;]" as &#37; is the ascii code for %

    hth, Thomas

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Feb 11, 2010 @ 12:51
    Jeroen Breuer
    0

    Nope still doesn't work.

  • Richard Soeteman 3875 posts 12037 karma points MVP
    Feb 11, 2010 @ 13:32
    Richard Soeteman
    1

    Hi Jeroen,

    [% will get replaced (it wants to retrieve the parameter test from a cookie collection). What I would do is just choose another prefix or suffix for you placeholder like _@ @_ , or  pass the value test to ReceiverPlaceHolder and surround it with [% and %] in the usercontrol.

    Hope it helps you,

    Richard

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Feb 11, 2010 @ 13:38
    Jeroen Breuer
    0

    Hi Richard,

    Thanks for the info. I was already thinking about the second option. I'm just going to surround my placeholder with [% and %] in the usercontrol. This way the parameters in umbraco are also more readable :).

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies