Let's go

KeyValuePair的使用

 Dictionary<string, string> dc = new Dictionary<string, string>();

前台页面:

        <div id="tb">
            @if (ViewBag.data != null)
            {
                foreach (KeyValuePair<string, string> item in ((System.Collections.Generic.Dictionary<string, string>)ViewBag.data))
                {
                    <input type="hidden" name="@item.Key" value="@item.Value" />
                }
            }
        </div>

 

posted @ 2019-06-19 14:34  chenze  阅读(2070)  评论(0编辑  收藏  举报
有事您Q我