Decimal values with thousand separator in Asp.Net MVC

The reason behind it is, that in ConvertSimpleType in ValueProviderResult.cs a TypeConverter is used. The TypeConverter for decimal does not support a thousand separator. Read here about it: http://social.msdn.microsoft.com/forums/en-US/clr/thread/1c444dac-5d08-487d-9369-666d1b21706e I did not check yet, but at that post they even said the CultureInfo passed into TypeConverter is not used. It will always be Invariant. string … Read more

ASP.NET MVC posted file model binding when parameter is Model

It turns out the reason is that ValueProviderDictionary only looks in Request.Form, RouteData and Request.QueryString to populate the value provider dictionary in the model binding context. So there’s no way for a custom model binder to allow posted files to participate in model binding without inspecting the files collection in the request context directly. This … Read more

MVC3 Non-Sequential Indices and DefaultModelBinder

I have this working, you have to remember to add a common indexing hidden input as explained in your referenced article: The hidden input with name = Items.Index is the key part <input type=”hidden” name=”Items.Index” value=”0″ /> <input type=”text” name=”Items[0].Name” value=”someValue1″ /> <input type=”hidden” name=”Items.Index” value=”1″ /> <input type=”text” name=”Items[1].Name” value=”someValue2″ /> <input type=”hidden” name=”Items.Index” … Read more