开发者

Custom Template Controls: .ascx or vbhtml

开发者 https://www.devze.com 2023-03-03 18:22 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消