Chapter 7. Leveraging existing ASP.NET features
This chapter covers
- Exploring the ASP.NET server controls
- Using caches, cookies, and sessions
- Applying the tracing feature
- Setting up health monitoring
- Leveraging site maps
- Configuring personalization and localization
Many of us have invested heavily in ASP.NET. With ASP.NET MVC now available as an alternative to Web Forms, is all that knowledge useless? Do we have to relearn this platform entirely from scratch?
You’ll be relieved to know that many of ASP.NET’s platform features work the same way they always have. Even some Web Forms server controls work. In this chapter, we’ll cover what works in ASP.NET MVC and what doesn’t. By the end of the chapter, you should feel comfortable using your existing knowledge of ASP.NET to build robust websites with ASP.NET MVC.
As you just learned, some ASP.NET server controls work with ASP.NET MVC, but which ones? How can we determine if a control will work?
To put it simply, any control that depends on ViewState or generates postbacks won’t be helpful. Some controls will render, but they require a <form runat="server">, which you might not want to add. Adding a server-side form tag will put hidden fields on the page for ViewState and event validation. The form will also POST to the same action you’re on, which is sometimes unacceptable.