Asp.net MVC 3 Razor code problem in a if statement

Posted by ray247 on Stack Overflow See other posts from Stack Overflow or by ray247
Published on 2011-01-16T05:45:03Z Indexed on 2011/01/16 5:53 UTC
Read the original article Hit count: 268

Filed under:
|

I have the following asp.net mvc 3 razor code, where "item" is my model,

<a @if (item.Selected) { class="youarehere" } href="@item.Href" title="@item.Title">@item.Description</a>  

This code throws up the following error,

CS1513: } expected

which is pointing to

class="youarehere"

portion of the code, but I could not figure out why. Could someone help point out how to fix it please? Thank you.

© Stack Overflow or respective owner

Related posts about asp.net-mvc-3

Related posts about Razor