Reputation: 487
I apologize if this has been asked before, I can't find the right search terms to get me to my answer.
I have the following line of code:
<div class="grid-col <%= (FeaturedVideo.HasLearnMoreLink || FeaturedVideo.HasRelatedArticles) ? "grid-col_7of10" : "grid-col_10of10"; %>">
The output I want is:
<div class="grid-col grid-col_7of10"> or <div class="grid-col grid-col_10of10">
Depending on the ternary statement. I'm getting the error "expression expected". I'm not familiar with doing a ternary statement in aspx so I'm sure I'm just missing something simple. What am I missing?
Thank you!
Upvotes: 0
Views: 509
Reputation: 487
I just needed a hash (#) instead of equals (=) in the ASP tag:
<div class="grid-col <%# (FeaturedVideo.HasLearnMoreLink || FeaturedVideo.HasRelatedArticles) ? "grid-col_7of10" : "grid-col_10of10"; %>">
Upvotes: 0