asp.net mvc - NullDisplayText Data Attribute -


i have mvc application , trying assign nulldisplaytext property fields in model, not getting results.

here portion of model data attribute, null value should cause output "(none)"...

public class task     ...     <displayformat(nulldisplaytext:="(none)", applyformatineditmode:=true, convertemptystringtonull:=true)>     public property estimatedprice nullable(of decimal)     ... end class 

when access property in view (strongly typed task of course) so...

@modeltype projectname.task @html.valuefor(function(model) model.estimatedprice) 

the debugger says model.estimatedprice = nothing output nothing. why nulldisplaytext attribute not correctly working here?

any ideas going wrong?

in order <displayformat> attribute apply in view, have use @html.displayfor , @html.editorfor helpers. example:

@html.displayfor(function(model) model.estimatedprice) 

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -