Frage

All the action is client side in a SPA app. The Visual Studio Durandal and Hot Towel project templates both serve the SPA out of an ASP.NET MVC application.

What, if anything, does the ASP.NET MVC infrastructure bring to the party? As far I can see all it does is make it hard to serve a WCF Web Service (ajax enabled) out of the project web.

Yet both of the project templates are set up like this. What have I missed?

War es hilfreich?

Lösung

As a matter of fact, ASP.NET MVC in this template is not necessary. All it does is serve the initial Razor template for the SPA and provides you with the bundling and optimization support of all the client side javascript resources for the application so that when you deploy your application you don't end up with gazillions of HTTP requests from the client to fetch all the .js crap necessary for the application to work. Of course you could perfectly fine have used the bundling feature outside of ASP.NET MVC in a simple and plain ASP.NET web application.

Andere Tipps

What, if anything, does the ASP.NET MVC infrastructure bring to the party?

See the documentation:

Hot Towel builds on the familiar and powerful ASP.NET MVC structure.

  • App_Start
  • Content
  • Controllers
  • Models
  • Scripts
  • Views

As far I can see all it does is make it hard to serve a WCF Web Service (ajax enabled) out of the project

You can't just right-click your project and add a new WCF Service?

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top