Monday, August 1, 2011

Razor tag nuances

Instead of doing this:

@{
    int i = 2;
    if (i == 2)
    {
        <text>Whatever great @i</text>
    }
}

You can do this:
@{
    
    int can = 3;
    if (can == 3) {
        @:Whatever great @can  
    }
}

No comments:

Post a Comment