Copied to clipboard

Flag this post as spam?

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


  • lucuma 261 posts 563 karma points
    Mar 17, 2012 @ 06:35
    lucuma
    0

    Macro Inconsistently Returning Result

    I've got a macro that checks a node to see if it has a value or if its parent has a property to determine what class to apply to a div.. It is pretty simple.. The problem I run in to frequently is that on the same page this macro returns different results.. Sometimes it returns nothing and other times it returns the same result (on the same page).. I turned off the caching on the macro.. Anyone have any ideas? 4.7.1

      if (Model.HasProperty("sectionClasses"&!String.IsNullOrEmpty(Model.GetProperty("sectionClasses").Value))
        {
          @Html.Raw(Model.sectionClasses).ToString(
                                                                                   
        }
        else if (Model.Level &Model.Parent.HasProperty("childSectionClass"&!String.IsNullOrEmpty(Model.Parent.GetProperty("childSectionClass").Value))
        {
               @Html.Raw(Model.Parent.childSectionClass).ToString()
        }

  • lucuma 261 posts 563 karma points
    Mar 17, 2012 @ 18:20
    lucuma
    0

    The macro produces a class that is used on a home page.. Sometimes the string is returned and other times it doesn't return anything all on the same page call..

Please Sign in or register to post replies

Write your reply to:

Draft