Chapter 6ASP.NET MVC Helpers and Extensions
What you will learn in this chapter:
- How to display dynamic information
- What Razor syntax is and how you use it in the view
- How routing works
- Creating actions on the controller
- Getting your controllers and views to work together
Code Downloads for this Chapter:
The wrox.com code downloads for this chapter are found at www.wrox.com/go/beginningaspnetforvisualstudio on the Download Code tab. The code is in the chapter 06 download and individually named according to the names throughout the chapter.
You have learned about how ASP.NET Web Forms take one type of approach, server controls, to do work whose outcome is rendered into HTML for consumption by the browser on the client machine. For example, a developer can add a server control to the markup and know that a textbox will be displayed in the browser. However, the complete structure of the HTML that is output is not within the developers' control unless they are using HTML controls, with their ancillary limited functionality.
The process is different in ASP.NET MVC. There is no such thing as a server control in the MVC world. There is, instead, a way of writing code “in the UI” that enables the developer to have complete control over the output that is sent to the client. As you can guess, however, “more control” means that you may have to do more writing of code. In some cases you may have scaffolding, or automatically created code (much like the project you started with), that ...
Get Beginning ASP.NET for Visual Studio 2015 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.