c# - Intellisense for model properties not working in View for HtmlHelper -
my question simple , might not important other coders, lot if 1 can explain me why can't intellisense
working when using displaynamefor
. working on displayfor
or other models, not one. while not helping me correct properties, telling me when there no such name of property.
error not contain definition "insert variable here"
well reassuring, why not tell me available then?
@model ienumerable<rmqgrainsbeta.models.expenseindexviewmodel> @{ viewbag.title = "expensesindex"; } <h2>expensesindex</h2> <table class="table table-bordered"> <tr> <th> @html.displaynamefor(model => model.sonumber) </th> <th> @html.displaynamefor(model => model.dateprocessed) </th> <th> @html.displaynamefor(model => model.stats) </th> <th> @html.displaynamefor(model => model.totalexpense) </th> </tr>
example if type in model.
<- not give me intellisense. if continue type in it, model.to
<- tell me there no definition of "to" in model.
your model
in (model => model.*)
ienumerable<expenseindexviewmodel>
not have properties sonumber
, dateprocessed
, etc. properties of expenseindexviewmodel
.
you'll need iterate on collection
@foreach(var item in model) { @html.displaynamefor(m => item.sonumber) }
Comments
Post a Comment