To write switch case in ASP.NET MVC Razor View, use below code snippet.
@switch (absolutePath)
{
case "/Complaints/D/":
<div>Company details</div>
break;
case "/Complaints/C/":
<div>Latest complaints</div>
break;
default:
<div>Latest complaints</div>
break;
}
Thanks