Skip to content

counsellorben/ASP.NET-MVC-JsonDictionaryBinding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

JSON Dictionary Binding

This project contains a custom ModelBinder and ValueProviderFactory for binding JSON dictionaries to MVC models.

Usage is simple. Modify your Global.asax.cs file to replace the standard MVC3 JsonValueProviderFactory with the ExtendedJsonValueProviderFactory. Then, if you have a JSON dictionary of a type other than Dictionary<string, object>, you can either use the TypedDictionaryModelBinder in your Controller's action method declaration, or you can set the binding for your typed dictionary in the Global.asax.cs file.

An example page can be seen at this page at Form.Vu.

Thanks to Jeroen, whose blog post here inspired me to revisit and fix my ExtendedJsonValueProviderFactory.

About

A small project including an updated ValueProvider and ModelBinder to permit binding JSON dictionaries to MVC models.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors