且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是否有ASP.NET Web应用程序目录结构的命名约定?

更新时间:2023-02-15 18:21:34

我喜欢受到Microsoft标准的启发,因为我们正在使用Microsoft技术。再加上好标准总比没有好,尤其是如果您在更大的团队中工作。

I like to be inspired by Microsoft standards, since we are using a Microsoft technology. Plus a somewhat good standard is better than no standard, especially if you work in a larger team.

App_Code当然是标准的,因为它在ASP.NET中具有功能,而不仅仅是***实践。

App_Code is standard of course, because it has a function in ASP.NET, not just a best practice.

我有点像MVC标准项目的结构:

I sort of like the MVC standard project's structure:


  • 内容-包含带有图像,Css,Javascript的子目录

  • 控制器-可能不适用在WebForms中

  • 视图-在WebForms中也可能过分使用

  • Content -- Contains subdirectories with Images, Css, Javascript
  • Controllers -- Maybe N/A in WebForms
  • Views -- Also maybe overkill in WebForms

内容文件夹可能是关键,因为它是ASP.NET项目的最低公分母。因此,如果您同时使用WebForms和MVC,就可以在所有项目中感到宾至如归,如果您知道该文件夹中有静态资源。

The "Content" folder is maybe the key, since it's the lowest common denominator for ASP.NET projects. So if you work with both WebForms and MVC you'll feel at home in all projects, if you know you have your static resources in that folder.