In my last post on ASP.NET 4.5 Web Forms features I talked about the new strongly-typed data controls that are available and how you can now get Intellisense as you access object properties within a server control template. It’s a great feature that you definitely need to check out if you haven’t already. Here’s a quick summary of what’s new when it comes to data-specific features in the ASP.NET 4.5 release:
In this post I’m going to focus on my overall favorite new feature in ASP.NET 4.5 called model binding (check out all of the new features in my Pluralsight course). Model binding isn’t exactly a “new” feature when it comes to .NET because ASP.NET MVC has had it for a long time. However, it’s new to ASP.NET Web Forms and yet another feature that will truly change how you write your application code if you take advantage of what it offers.
What is Model Binding?
In a nutshell, model binding is the process of getting model objects in and out of controls without writing a lot of plumbing code to do it. You can now bind data controls directly to methods that provide select, insert, update and delete functionality. When the methods are called you don’t have to write a lot of code to access the values that were posted back in the case of update, insert, or delete operations. Instead, model binding allows you to have a given model object’s properties (a class with properties if you’re not familiar with model objects) automatically filled with the posted back data.
Continue reading →
Like this:
Like Loading...