MVC .Net 前端和后端
我对 .Net 和 MVC 特别陌生。我正在构建一个需要前端和后端(管理站点)的网站。我创建了一个项目并正在开发前端,现在如何启动该网站的后端?我需要创建新的解决方案吗? (“解决方案”到底是什么?
非常感谢
I am very new to .Net and MVC specifically. I am building a site which will need a front end and a back end (admin site). I created a project and am developing the front end, now how do I start a back end for this site? Do I need to create a new solution? (what exactly is a "solution"?
Thanks so much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
除非管理区域托管在不同的域上,否则您没有理由不对两个站点使用相同的项目。如果您确实共享该项目,您可能希望将配置管理控制器放入单独的 ASP.NET MVC 区域。
“解决方案”是一组项目。例如,解决方案可能包含一个 Web 应用程序项目、一个控制台应用程序项目和一些共享类库项目。
There's no reason why you wouldn't use the same project for both sites, unless the admin area is to be hosted on a different domain. If you do share the project, you'll probably want to place configure the admin controllers into a separate ASP.NET MVC Area.
A "solution" is a group of projects. For example, a solution might contain a web application project, a console application project, and a few shared class library projects.
Paul,
在 Visual Studio 中,一个“解决方案”可以包含一个或多个“项目”。一个项目(大部分)和您尝试创建的应用程序。在您的例子中,这是一个 ASP.NET MVC“项目”。
如果您正在构建 ASP.NET MVC 应用程序,那么您的前端和后端可以(并且可能应该)是同一个项目。允许您访问“管理”页面的 URL 与该站点的站点不同(很可能),但该项目实际上是相同的。
除非管理站点的域不同,否则无需将管理站点开发为不同的 ASP.NET MVC 项目。
如果这不能回答您的问题,请告诉我们您对两个“端”(前端和后端)的 url 的想法。
Paul,
In Visual Studio, a "Solution" can contain one or more "projects". A project (for the most part) an the application you are trying to create. In your case an ASP.NET MVC "project".
If you're building an ASP.NET MVC application, then your front and backend could (and probably should) be the same project. The url that gives you access to your "admin" pages is different from the site of the site (most likely) but the project is really the same.
Unless the domain for the admin site will be different there is no need to develop the admin site as a different ASP.NET MVC project.
If this doesn't answer your question, please let us know what you have in mind as regards the urls of the two "ends" (front and back ends).