Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How do you go about checking if a property exists and has value? "HasValue(string)" seems to only check if the property exists at all?
@if(@product.Node.HasProperty("productSalePrice")){ <span class="price">Price: <span class="salePrice">@product.OriginalPrice.ToString("C")</span> @product.Node.GetProperty("productSalePrice")</span> } else { <span class="price">Price: @product.OriginalPrice.ToString("C")</span> }
Got it!
@if(@product.Node.HasProperty("productSalePrice") && @product.Node.GetProperty("productSalePrice").Value != String.Empty)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Check if property exists and has value
How do you go about checking if a property exists and has value? "HasValue(string)" seems to only check if the property exists at all?
Got it!
is working on a reply...