I have a custom type Money for my ViewModel:
public class Money
{
public Money(decimal value)
{
Value = value;
}
public decimal Value { get; private set; }
public override string ToString()
{
return string.Format("{0:0.00}", Value);
}
}
and I want to render a textbox in ASP.NET MVC via HTML.EditorFor(viewModel => viewModel.MyMoneyProperty) but it doesn't work. Is there a special interface which I have to implement in Money?
Best regards and thanks in advance,
Steffen