What is the reason that ASP.NET MVC templates are available only for Web Application projects and not for Web Site projects?
What is the reason that ASP.NET MVC templates are available only for Web Application
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Web Site projects work by giving you the option of letting your pages be compiled on the fly. That means that your code in the code-behind (or in the page) for those pages isn’t compiled until a request is made to view the page. The only reason that works is because your page and the code-behind for it are tied together.
In an ASP.NET MVC Project, a user doesn’t request a page. They enter a URL and the URL Routing directs the request to the appropriate Controller for handling. Since Views and Controllers aren’t implicitly linked like ASPX and Code-Behind files, they need to be pre-compiled.
Therefore, the Web Application is the only option that will work for ASP.NET MVC.