This is the line that is not working:
ModelBinders.Binders.Add(typeof(decimal), new DecimalModelBinder())
To be more precise. Binders is highlated.
I found this article by Phil Haack.
I did all it said, added refrences to using System.Web.Http.ModelBinding.Binders;
Added class public class DecimalModelBinder : IModelBinderto a new folder and told to Global.ascx about the folder. But the red line keeps showing underneath the Binders. Can you help me?
From the error it looks like it is treating the
ModelBindersas namespace (which is present in your project) instead of the framework class.Try using the below line which will resolve the ambiguity.