Custom Template Controls: .ascx or vbhtml
Does anyone have any recommendations about using a .ascx file (user control) versus a .vbhtml/.cshtml (razor) for custom templates? It would appear from my limited interaction that they are completely interchangeable.
Is it purely a matter of co开发者_Go百科mfort/experience or are there pros and cons to each method?
Thanks
Yes, they are interchangeable. But if your main application uses Razor I would recommend you using Razor for those templates. Unless you have some legacy code from some older ASP.NET MVC 2 application that you want to reuse. For all new views I recommend Razor.
精彩评论