Articles : Page 7 of 22
- Filter:
- Model
-
A first look at Windows Azure AppFabric Applications
Jul 1107After the Windows Azure AppFabric team announced the availability of Windows Azure AppFabric Applications (preview), I signed up for early access immediately and got in. After installing the tools and creating a namespace through the portal, I decided to give it a try to see what it’s all about. Note that Neil Mackenzie also has an extensive post on “WAAFapps” which I recommend you to read as well. So what is this Windows Azure AppFabric Applications thing? Before answering that question, le...
-
Custom Model Binder for binding drop downs into a DateTime in MVC
Jul 1106I have a Nullable DateTime Property in my Model I want to bind painlessly with three drop down select boxes I have for Day Month and Year respectively. First thing to do is to make a new shiny custom model binder. I have done mine by inheriting from DefaultModelBinder (which you will need to include System.Web.Mvc to access). using System; using System.ComponentModel; using System.Web.Mvc; namespace Infrastructure.OFP.ModelBinders { public class MyUserModelBinder : DefaultModelBinder { protect...
-
What’s the Difference Between a Value Provider and Model Binder?
Jun 1130ASP.NET MVC 3 introduced the ability to bind an incoming JSON request to an action method parameter, which is something I wrote about before. For example, suppose you have the following class defined (keeping it really simple here): public class ComicBook { public string Title { get; set; } public int IssueNumber { get; set; } } And you have an action method that accepts an instance of ComicBook: [HttpPost] public ActionResult Update(ComicBook comicBook) { // Do something with ComicBo...
-
A Simple Example That's Incredibly Complex
Jun 1130I was reading through my RSS feeds and email, just having returned from Paris and I was asked to take a look at a project from Microsoft Spain up on Codeplex. In reading the summary, it looks to be a sample application utilizing some high-end tricks from DDD (emphasis mine): This project is a sample implementation of most used patterns in Domain Oriented Architectures based on simple scenarios easy to understand (Customers, Orders, Bank Transfers, etc.).It is an Educational example, not a r...
-
MVC Filters: Easily Add Performance Counters to Your MVC Application
Jun 1130Ben Grover adds performance counters to a Model-View-Controller (MVC) app and explains how to use MVC filters to clean up and replace repeated, confusing code that was spread throughout numerous action methods in an application. Ben Grover MSDN Magazine July 2011...
-
Manual Validation with Data Annotations
Jun 1130Several people have asked me about using data annotations for validation outside of a UI framework, like ASP.NET MVC or Silverlight. The System.ComponentModel.DataAnnotations assembly contains everything you need to execute validation logic in the annotations. Specifically, there is a static Validator class to execute the validation rules. For example, let's say you have the following class in a console mode application: public class Recipe { [Required] public string Name { get; set; } } Y...
-
The history of ASP.NET MVC, so far
Jun 1129This post is a mile high overview of the history of ASP.NET MVC, the features it brought with the various versions and the extensibility points introduced. I am starting to work on both a series of webcasts and articles and I was doing some preparatory work, collecting information on the various features and extensibility points that got into the various (official) releases of ASP.NET MVC, so I thought it could have been useful to share my little summary. There have been 3 major official r...
-
Announcing the Web Standards Update - HTML5 Support for the Visual Studio 2010 Editor
Jun 1115Folks have been asking When will VS2010 support HTML5? I've been saying, jokingly, that the answer is yesterday as there's nothing keeping you from creating HTML5 in Visual Studio or ASP.NET today. However, there's no intellisense and there's lots of squiggly lines that make people uncomfortable. Combine all that with the fact that HTML5 is a moving target, and it's unclear. We've said before that the next version of Visual Studio will have better support HTML5, but what about today? Today,...
-
Diving into ASP.NET MVC 3 Model Metadata Providers
Jun 1103ASP.NET MVC provides a great support for DataAnnotation attributes which can be used to enable rich metadata behavior within MVC models. ASP.NET MVC 3 introduced the support for new DataAnnotation DisplayAttribute. ModelMetadataProvider can be used to create ModelMetadata based on the model’s attributes. In this article, we will explore how ModelMetadataProvider is extensible and we could easily create our own MetadataProvider to support any custom behavior. ASP.NET MVC 3 also introduced new reg...
-
Just released: MvcSiteMapProvider 3.1.0 RC
May 1127It looks like I’m really cr… ehm… releasing way too much over the past few days, but yes, here’s another one: I just posted MvcSiteMapProvider 3.1.0 RC both on CodePlex and NuGet. The easiest way to get the current bits is this one: As usual, here are the release notes: Created one NuGet package containing both .NET 3.5 and .NET 4.0 assemblies Significantly improved memory usage and performance Medium Trust optimizations DefaultControllerTypeResolver speed improvement Resolve author...

