Веб-формы Asp.Net против веб-сайта Asp.Net (бритва) против MVC Asp.Net
Я думаю, что у Microsoft должна быть причина для улучшения ASP.Net с помощью синтаксиса RAZOR.
НаCreate New Website Project В диалоге Visual Studio есть еще один вариант создания ASP.Net (Razor). В первый раз я наткнулся на терминRazor когда я читал книгу на Asp.Net MVC, я не знал, что она существует для ASP.Net
Я знаю, для чего нужен синтаксис Razor, введенный в MVC 3. Прежде чем задать этот вопрос, я решил создать тестовый проект для ASP.Net (Razor) и посмотреть, чем он отличается от обычных веб-форм ASP.Net и ASP.Net. MVC. Я не обнаружил никаких папок Model / View / Controllers, как у нас в MVC.
Я обнаружил, что главная страница указана по-другому, а главная страница чище, не более<asp:ContentPlaceHolder />
Но мои вопросы:
I notice it uses.cshtml
, are there no more codebehinds?
similarities and differences between ASP.Net (Razor) and ASP.Net MVC
Can it be extended to function like ASP.Net MVC e.g. adding Controller?View/Model, Custom Routing I guess?
Why does this exist when we have ASP.Net MVC? Wouldn't this encourage reluctance to move to ASP.Net MVC?
and why would you choose ASP.Net+Razor over ASP.Net MVC?
UPDATE: ASP.NET Web Pages in particular was designed to make it easy for people who already know HTML to add server processing to their pages. It's a good choice for students, hobbyists, people in general who are new to programming. It can also be a good choice for developers who have experience with non-ASP.NET web technologies
Update ASP.NET Web Pages ASP.NET Web Pages targets developers who want a simple web development story, along the lines of PHP. In the Web Pages model, you create HTML pages and then add server-based code to the page in order to dynamically control how that markup is rendered. Web Pages is specifically designed to be a lightweight framework, and it's the easiest entry point into ASP.NET for people who know HTML but might not have broad programming experience — for example, students or hobbyists. It's also a good way for web developers who know PHP or similar frameworks to start using ASP.NET.
Пожалуйста, мне нужно ваше техническое мнение. Благодарю.