for Attribute:range (min,max) min and Max must be in use, but the requirements sometimes need to put these two values in db, dynamically removed. At this time need razor help:
@Html. textboxfor (i = i.amount, new { @class = "Form-control", data_val_range = string. Format (Resx.amountoutofrange_0_1, Model.minvalue, Model.maxvalue), Data_val_range_max = Model.maxvalue, Data_val_range_min = Model.minvalue })
This will generate the following HTML:
<input class= "Form-control" data-val= "true" data-val-number= "field amount must be number" data-val-range= " The withdrawal amount ranges between 100.00 and 10000.00. "data-val-range-max=" 10000.00 "data-val-range-min=" 100.00 "data-val-remote=" ' Amount ' is invalid. " Data-val-remote-additionalfields= "*. amount,*. Currency "data-val-remote-url="/xxx/yyy "data-val-required=" Please enter the amount. "Id=" Amount "name=" Amount "type=" text "value=" 0 ">
Late binding of Max and Min values in a range in MVC