I\'m trying to do something different. I have a view that contains an Id. Based on the value of the Id I want to change my heading that appears. Something like:
@switch (id)
{
case "test": Test Site
break;
case "prod": Prod Site
break;
}
There is no need to enclose the entire switch statement in a @{}
block, (unlike Joel Etherton's post)
Your errors are basically regular syntax errors and have nothing to do with razor;
the variable wasn't in parenthesis
the body of switch wasn't in brackets
no "break" after the first statement.