milan2004
دوشنبه 16 اسفند 1395, 14:36 عصر
سلام
من در ویو مدلم یک پراپرتی از نوعDictionary دارم ولی وقتی پیمایش میکنم مقدار کلید اون رو نمایش نمیده
@foreach (KeyValuePair<string,bool> item in Model.Role)
{
<div class="form-group">
@Html.LabelFor(Model =>item.Key, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => item.Value, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => item.Value, "", new { @class = "text-danger" })
</div>
</div>
}
من در ویو مدلم یک پراپرتی از نوعDictionary دارم ولی وقتی پیمایش میکنم مقدار کلید اون رو نمایش نمیده
@foreach (KeyValuePair<string,bool> item in Model.Role)
{
<div class="form-group">
@Html.LabelFor(Model =>item.Key, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => item.Value, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => item.Value, "", new { @class = "text-danger" })
</div>
</div>
}