KeyValuePair的使用

Posted chenze-index

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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>

 

以上是关于KeyValuePair的使用的主要内容,如果未能解决你的问题,请参考以下文章