To configure .cshtml for the client, several steps are required.
I created a sample project called AngularAspNet on GitHub .
1) App Angular. , .
2) .cshtml App/xxx/Components/. , .

Angular View Component ( JavaScript). , View , . .js Views, .chtml App (Angular Script).
1) web.config BlockViewHandler .
<?xml version="1.0"?>
<configuration>
<configSections>
...
<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*.cshtml" verb="*"
preCondition="integratedMode"
type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
...
</configuration>
4) .
public class NgController : Controller
{
public PartialViewResult RenderComponents(string feature, string name)
{
return PartialView($"~/App/{feature}/Components/{name}");
}
}
5) .
routes.MapRoute(
name: "Components",
url: "{feature}/components/{name}",
defaults: new { controller = "Ng", action = "RenderComponents" });
AngularJS ASP.NET MVC 5
Matt Honeycutt
AngularJS ASP.NET MVC