Apr 17, 2018, 8:28 AM
Use Bind/BindString with data not stored in ViewModel
Is it possible to use the bind or bindstring properties with data from other sources than ViewModel?
I did define a data object in the "head" section, e.g.:
I did define a data object in the "head" section, e.g.:
@{
var X = Html.X();
var dat = new { maxValue = 1000 };
}
and I tried to use it inside a NumberField:X.NumberFieldFor(mod => mod.Level).FieldLabel("Level")
.AllowDecimals(false)
.MinValue(-1)
.BindString("dat")
My Goal is to define some properties in the head, so I can reuse them on several fields in the Markup.