Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Microsoft's .NET framework was upgraded to version 4.5 in late 2012. Here are some of the new features that you might find useful in your ASP.NET websites. First of all, the .NET framework now supports a new coding model for executing asynchronous HTTP requests, where you send off a request and then the main thread of your code can continue executing while the request is processed on a remote server. When the response comes back, it's up to you to write the code to process that response. In the past, HTTP requests and responses had to be written as separate methods. But now there are two new key words called Await and Async that are implemented in both C# and Visual Basic. Here's how it looks in C#. You mark any method that's going to make an asynchronous call with the Async key word and then you place the Await keyword before any method that you are calling that will be asynchronous. This will result in pausing your code and waiting for the response to come back. This is an alternative to writing callback methods-- separate methods that will be called as an event handler. It results in more coherent, readable code. You can still do the same things as before, making calls to remote servers, but now the code is cleaner and easier to read. This same feature is commonly used in Windows 8 store apps--applications that run in the new start screen on Windows 8 and Windows RT. ASP.NET 4.5 also has features that are unique for web processing. These include request validation features, the ability to defer validation of a request, and the ability to support unvalidated requests, giving your ASP.NET websites much more flexibility in how they interact with the rest of the computing world. There's also now support for web sockets, a particular kind of communication over the internet that's a little bit different than HTTP.
Get unlimited access to all courses for just $25/month.Become a member