Copied to clipboard

Flag this post as spam?

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


  • Moran 285 posts 934 karma points
    Jun 29, 2013 @ 09:20
    Moran
    0

    putting dictionary items in server tags

    Hi

    Is there a way to put a dictionary item in server tags? ex:

    <asp:LoginStatus ID="RescueLoginStatus" LoginText='<umbraco:item Field="#LoginText" runat="server"/>' runat="server" />

    Where "LoginText" is the dictionary items of course. I have tried to put it in 

    #eval(umbraco.library.GetDictionaryItem("LoginText") 

    but I got an error

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 29, 2013 @ 10:38
    Jan Skovgaard
    0

    Hi Moran

    What kind of error do you get? What does it say?

    Perhaps you can find some tips on how to do this by reading this blogpost by Tim Geyssens? http://www.nibble.be/?p=14

    /Jan

  • Moran 285 posts 934 karma points
    Jun 29, 2013 @ 11:57
    Moran
    0

    Hi Jan

    This is the error I get when I put the Eval function, it won't work if I put the "=" sign either.

    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: The server tag is not well formed.

    Source Error: 

    Line 76:                 <form id="umbMasterForm" runat="server">
    Line 77:                     <h2>
    Line 78: <asp:LoginStatus ID="RescueLoginStatus" LoginText="<%#Eval(umbraco.library.GetDictionaryItem("LoginText") %>" runat="server" /> Line 79:                     </h2>
    Line 80:                     <asp:ContentPlaceHolder ID="cp_content" runat="server"></asp:ContentPlaceHolder>
  • Moran 285 posts 934 karma points
    Jul 01, 2013 @ 07:51
    Moran
    0

    any answer on this? do I need to provide more information?

    Thanks/

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 01, 2013 @ 09:46
    Dirk De Grave
    100

    it just won't work this way.. Better solution is to declare public properties (or functions) in your codebehind to fetch dictionary items eg.

    public string LoginText { get { return umbraco.library.GetDictionaryItem("LoginText"); } }

    Cheers,

    /Dirk

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jul 01, 2013 @ 10:37
    Ismail Mayat
    0

    Moran,

    There was a blog post for expression builder for umbraco see http://our.umbraco.org/forum/developers/api-questions/5407-Macro-parameters-from-codebehind 4th post by Murray.  The link to the post is dead im afraid however the  other link http://weblogs.asp.net/infinitiesloop/archive/2006/08/09/The-CodeExpressionBuilder.aspx is live so you could do something similar.

    Regards

    Ismail

  • Moran 285 posts 934 karma points
    Jul 03, 2013 @ 13:11
    Moran
    0

    Thanks Dirk :) this looks like a good way to implament. and thank you Ismail too.

Please Sign in or register to post replies

Write your reply to:

Draft