Copied to clipboard

Flag this post as spam?

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


  • Daniel Draper 36 posts 57 karma points
    Apr 19, 2011 @ 02:30
    Daniel Draper
    0

    Umbraco 4.7 Razor Bug?

    Sorry if this is a duplicate post or bug but I was unable to search got the string _@ and was too lazy to try different "safe" alternatives.

    Situation:
    Lets assume I have  a macro that lists all images in said folder clicking on an image shows a lightbox which is pretty standard stuff.

    As part of lightbox you can use an anchor tag with rel attribute to group images <a rel="gallery_12" however when trying to use the syntax <a rel="[email protected]" razor does not seem to recognise/render/output the Model.Id property.

    Solution:
    use a dash instead of an underscore which goes against umbracos freedom =P

    Does anyone have any other solutions for usng _ without creating a variable and setting a string with the class name which I am currently doing?

     

    Cheers

    Dan

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Apr 19, 2011 @ 10:44
    Sebastiaan Janssen
    1

    Make it explicit by using braces: 

    "gallery_@(Model.Id)"
  • 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