Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Contributor
6409 Points
1184 Posts
May 01, 2012 01:13 PM|LINK
Using the EditorFor HtmlHelper may solve your issue:
[DisplayFormat(DataFormatString = "{0:0.00}", ApplyFormatInEditMode=true)] public decimal? Salary { get; set; }
@Html.EditorFor(m=>m.Salary)
mm10
Contributor
6409 Points
1184 Posts
Re: Using DataFormatString in the DisplayFormat attribute
May 01, 2012 01:13 PM|LINK
Using the EditorFor HtmlHelper may solve your issue:
[DisplayFormat(DataFormatString = "{0:0.00}", ApplyFormatInEditMode=true)]
public decimal? Salary
{
get;
set;
}
@Html.EditorFor(m=>m.Salary)