Switch case in ASP.NET MVC Razor View

Sheonarayan
Posted by Sheonarayan under ASP.NET MVC category on | Points: 40 | Views : 1133
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

Comments or Responses

Login to post response