Hi all,
I’m currently using a CMS running on .net framework building a number of Razor views to render on the page. I have a couple of other questions, though this is the easier one first
For some reason, which I can’t figure out is why the error keeps saying something about ...}
being out of place or not matching.
Any ideas what the problem is from the code below?
Am I missing something, need to change something because it’s a razor?
And would it be better to have an if else statement instead of two separate if statements, or the below is better, faster, more cleaner?
@{
if ((category == "Abstract") || (category == "Poster"))
{
<p>Abstract or Poster show PDF</p>
<p><a href="@d"><img src="@a" alt="@title"></a></p>
}
if (category == "Photograph")
{
<p>This is a photograph</p>
<p><a class="popup" href="#modal"><img src="@a"></a></p>
<div class="popup hide" id="modal">
<img src="@b">
@if (caption.Length != 0) {
<div class="img__caption">@caption</div>
}
</div>
}
}
Thanks, Barry