MVC视图中读取ViewBag传递过来的HashTable表数据

时间:2022-09-07 07:22:48
视图中头部添加 @using System.Collections;

循环读取哈希表数据 
 <ul id="AccessView" class="sys_spec_text">
@foreach (DictionaryEntry item in (ViewBag.FieldsValues as Hashtable))
{
<li title="@item.Value">
<a id="@item.Key" lable="@item.Value"><img src="/Content/Images/Icon16/tag_blue.png">@item.Value</a><i></i></li>
}
</ul>