Apps

ASP.NET 4.5 features make upgrade worth the trouble

Tony Patton gives an overview of the notable features that are available with ASP.NET 4.5.

Microsoft continues to add new features and fix others in ASP.NET, while I continue to support an ASP.NET 1.1 application along with many others using the various flavors of ASP.NET. The latest version to hit the streets (ASP.NET 4.5) coincides with the release of .NET Framework 4.5. It was released late last year, but I am just now diving in to it as I begin development on an application for a new client. Here's a quick tour of ASP.NET 4.5; I'll focus on specific features in future posts.

Version confusion

The 4.5 version number deserves discussing for the pure fact that it is a little confusing. Microsoft has been releasing technologies (via CodePlex) even before .NET Framework 4.5 was released; for this reason, the version numbers for the various technologies within the framework are out of sync.

Microsoft incremented the base framework and ASP.NET a half point (4 to 4.5), while core languages received a full increase with C# 5.0 and Visual Basic 11. Past upgrades have allowed you to utilize multiple versions side-by-side, but this is tricky, as the .NET Framework 4.5 installation replaces libraries used in 4.0 applications.

In short, be careful with the upgrade. I am in such a situation, so I will discuss this in more detail in the future.

Where do we begin?

There are too many features in ASP.NET 4.5 to cover in one post, so I'll stick with some of the notable features added or enhanced in this version.

  • Web Sockets: Full support for the Web Sockets HTML5 standard is available with ASP.NET 4.5 running on IIS 8.0 via the SignalR library. This allows you to easily add real-time Web functionality to applications.
  • Authentication: There is now a universal provider (DefaultMembershipProvider) for simplification. In addition, the OAuth protocol is embraced.
  • Async programming: While this feature is not ASP.NET-specific, it is worth noting that C# 5 and Visual Basic 11 provide async support without using multiple threads (via async and await keywords).
  • Web publishing: This feature has been enhanced, whereas you can compare local and remotes files, publish only selected files, and so forth.
  • Web API: This API provides the REST approach to building applications -- a key difference from the WCF alternative. In addition, the Web API now includes extensive OData support, which is another instance of Microsoft embracing open source standards.
  • Friendly URLs: The popularity of tinyurl demonstrates the widespread problem of keeping up with long, arcane URLs. This feature is now available with ASP.NET applications via the FriendlyURLs feature.
  • Mobile: The explosion of smartphones, eReaders and other mobile devices has changed the landscape for Web application development. HTML5 support is supposed to simplify mobile application development. In addition, MVC 4 includes mobile templates, and there are a variety of mobile device emulators that can be used in Visual Studio 2012.
  • IIS: This allows you to use new features available in Internet Information Server (IIS) 8.0. Some of these features include prefetching and application initialization like application ping on startup. Also, an express edition of IIS is now available.

Web Forms

Once upon a time I thought Web Forms may be on their way out, but ASP.NET 4.5 proves me wrong with many updates to the stalwart of ASP.NET interface design. These enhancements are one of the reasons I was intrigued by the newest release of ASP.NET.

While MVC developers are fully aware of model binding, it is now available to the Web Forms world. Model binding binds a value in the client application to a model on the server -- this allows validation on the server. In addition to model binding, ASP.NET 4.5 offers strongly typed. A new ModelType property has been added to the data controls that allows you to specify the type of object that is bound to the control. The IQueryable object allows you to manipulate the query to provide paging, sorting, and much more. Web Forms also adds HTML5 support.

ASP.NET 4.5 includes a feature called unobtrusive validation that allows you to configure validator controls to use unobtrusive JavaScript for client-side validation logic. The net result is a large reduction in the amount of JavaScript rendered inline in the page markup. If you prefer an alternative, ASP.NET MVC 4 and Web Pages 2 are available.

Open source

This may be showing my age, but I am still surprised at how .NET has embraced open source in so many ways. The robust support for HTML5 and JavaScript (including jQuery libraries) in building ASP.NET and Windows 8 applications is a great example. I was skeptical when the CodePlex site first arrived, but it has proved to be a great vehicle for pushing new projects (as well as for providing Microsoft with an outlet to release technology updates). A good example of such a project is JSON.NET. The future seems bright for open source and .NET.

Too much for one person

I will pick certain ASP.NET 4.5 features as we build a new application, but I will use older methods for some features. The days of one developer keeping up with all facets of the .NET Framework and ASP.NET are over -- the technology and products is overwhelming. This is why you have some developers who stick with Web Forms (my hand is raised), others who jump on the MVC train, and still others use both or alternatives.

The complexity of the .NET technologies overwhelmed me in the past, but I now realize it is a great situation because it provides flexibility and options when building an application; this fosters the creativity that so many developers love and crave.

Keep your engineering skills up to date by signing up for TechRepublic's free Software Engineer newsletter, delivered each Tuesday.

About

Tony Patton has worn many hats over his 15+ years in the IT industry while witnessing many technologies come and go. He currently focuses on .NET and Web Development while trying to grasp the many facets of supporting such technologies in a productio...

5 comments
lishchuk
lishchuk

Despite the fact MS delivers versions very often, may be too often, Visual Studio 2012 is still well behind good-old Eclipse+java technologies (where VS has been mimicked from originally) 1) Slow, I mean really slow 2) Crash-proven (just reboot VS, to make it work again) 3) The worst thing is that VS does not rely on the source code itself, it keeps some "knowledge" in its own metadata (xml) as a result, there often a need to restart VS to make your project work, etc. 4) you always on the MS hook to upgrade-upgrade-upgrade, buy-buy-buy Mediocre technology gets marketed very well, Hype, hype, hype

bill.dickson
bill.dickson

I am glad to see that Web Forms are not dying. I switched to developing Web applications during the last three years after programming Windows Apps in VB.Net for many years. Web Forms seemed to be easiest learning curve at that time. MVC seems to have too much plumbing for my taste. .

333239
333239

I guess you think Visual Studio 97 was "mimicked" from Eclipse 3 (2004)??

D0c
D0c

It's all about being productive quickly. Web Forms was easy for you to understand because it packages most of the "plumbing" required for real the HTTP request/response interactions, making a web form operate similar and well packaged like a windows form. MVC tends to expose the plumbing, giving more control to you the dev. However, how quickly one can develop in either is really up to you...

Editor's Picks