Copied to clipboard

Flag this post as spam?

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


  • atze187 160 posts 215 karma points
    Nov 12, 2009 @ 17:35
    atze187
    0

    Custom section and edit page...

    Hi,

    i have made up a edit page for a custom tree and to keep the layout clean i used the UmbracoPanel from umbraco.uicontrols. This UmbracoPanel has a property "Text" which displays the header of the page. When i tried to bind this property to a localize string defined in the umbraco/config/lang/de.xml file via markup

    <cc1:UmbracoPanel runat="server" ... Text='<%# umbraco.ui.Text("bla", "oops") %>'>

    it won't render the string, when doing

    this.Panel2.Text = umbraco.ui.Text("bla", "oops");

    in the codefile everything shows up perfectly and localized.

    Any ideas, why using the markup could fail (or even if something is wrong with my binding syntax)?

    Cheers,
    André

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Nov 12, 2009 @ 22:31
    Aaron Powell
    0

    Are you sure that DataBind is implemented & called for the page? I can't remember if it's always called as part of the page life cycle.

    Personally I prefer to use <%= ... %> rather than the data binding sytax, unless I have control over whether I can call DataBind or not.

  • atze187 160 posts 215 karma points
    Nov 12, 2009 @ 22:54
    atze187
    0

    Unfortunately i cannot use <%= ... %> as the Text property is part of a server tag, have to do some binding (sometimes you just cannot see the wood from the trees). I'll give data binding a try tommorrow.

  • atze187 160 posts 215 karma points
    Nov 13, 2009 @ 10:02
    atze187
    0

    Calling DataBind() within the page does the job. Thanks.

Please Sign in or register to post replies

Write your reply to:

Draft