ASP.NET MVC Beta Released
page 5 of 14
by Scott Guthrie
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 58237/ 69

Improved UpdateModel and TryUpdateModel methods

The UpdateModel and TryUpdateModel methods now support several new options and overloads (including richer whitelist and blacklist options). 

It also now optionally supports the ability to just call "UpdateModel" to populate an instance with the default binding rules (with preview 5 you always had to supply a whitelist - and several people asked for an option to just map all):

Figure 13

Another new feature in today's beta is the ability to define a strongly-typed whitelist filter that you use with UpdateModel/TryUpdateModel.  You can do this by defining an interface with the subset of bindable properties that you want to map.  For example, below I'm defining a "IPersonFormBindable" interface that only has three properties (and does not have the salary property):

Figure 14

We could then indicate that we want to use this contract to limit which properties are mapped using code like below:

Figure 15

This will ensure that only those properties defined on the IPersonFormBindable interface are mapped - and that the Salary one is not mapped.

View Entire Article

User Comments

Title: how about validation   
Name: geocine
Date: 2010-12-15 7:42:28 PM
Values are not mapped but validations are still executed.
Title: sikat ang pinoy   
Name: renanorola
Date: 2010-02-05 8:35:24 PM
Creating silverlight on mvc are now easy. Thanks for the tutorials I like how you have presented the information in full detail. Keep up the great work
Title: ASP.NET MVC   
Name: Ranganathan
Date: 2009-02-09 1:54:22 AM
Today's beta release is a step closer to the final ASP.NET MVC 1.0 product. While not 100% feature complete, we think the major subsystems are all getting really close to being done, and that the quality level is now pretty good.

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-07-25 11:41:11 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search