How can I use cshtml files with Durandal?

后端 未结 8 2264
你的背包
你的背包 2020-12-01 01:50

I got the DurandalJS StarterKit template on VS2012... All works great...

But in some views I need to do something like that:

@if (Roles.IsUserInRole(         


        
8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 02:10

    Yes, you can absolutely use cshtml files with Durandal and take advantage of Razor on the server. I assume that also means you want MVC, so you can do that too and use its routing.

    If you don;t want the routing then you can set the webpages.Enabled in the web.config, as the other comments suggest.

     
    

提交回复
热议问题