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的使用的更多相关文章

  1. C# KeyValuePair<TKey,TValue>的用法-转载

    C# KeyValuePair<TKey,TValue>的用法.结构体,定义可设置或检索的键/值对.也就是说我们可以通过 它记录一个键/值对这样的值.比如我们想定义一个ID(int类型)和 ...

  2. C# winform key value型数据如何绑定ComBox (hashtable,keyvaluepair,dictionary )

    cbUserAgent是一个combox ArrayList list = new ArrayList(); Dictionary<string, string> useragents = ...

  3. KeyValuePair

    KeyValuePair用法(转)(2012-06-25 10:47:35) 转载▼ // 标签: keyvaluepair it   KeyValuePair C# KeyValuePair< ...

  4. The default for KeyValuePair

    if (getResult.Equals(new KeyValuePair<T,U>())) or this: if (getResult.Equals(default(KeyValueP ...

  5. Check if KeyValuePair exists with LINQ's FirstOrDefault

    http://stackoverflow.com/questions/793897/check-if-keyvaluepair-exists-with-linqs-firstordefault 问题: ...

  6. C# KeyValuePair<TKey,TValue>与Container

    KeyValuePair<TKey,TValue>  KeyValuePair<TKey,TValue>是一个结构体,相当于C#一个Map类型的对象,可以通过它记录一个键/值对 ...

  7. KeyValuePair用法(转)

    转载自:http://blog.sina.com.cn/s/blog_9741eba801016w61.html C# KeyValuePair<TKey,TValue>的用法.结构体,定 ...

  8. Unity3d中Dictionary和KeyValuePair的使用

    using UnityEngine; using System.Collections; using System.Collections.Generic;public class test : Mo ...

  9. List<KeyValuePair<TKey,TValue>> 与 Dictionary<TKey,TValue> 不同

    两者都可以通过 KeyValuePair<TKey,TValue> 进行遍历,并且两者可以相互转换: List<KeyValuePair<string,string>&g ...

  10. KeyValuePair 和 Dictionary 的关系和区别

    KeyValuePair 和 Dictionary 的关系 1.KeyValuePair      a.KeyValuePair 是一个结构体(struct):     b.KeyValuePair  ...

随机推荐

  1. spring基于注解的IOC

    曾经的XML配置: <bean id="accountService" class="com.itheima.service.impl.AccountService ...

  2. windows7任务管理器内存相关列详细解释

    内存 - 工作集:私人工作集中的内存数量与进程正在使用且可以由其他进程共享的内存数量的总和.  内存 - 峰值工作集:进程所使用的工作集内存的最大数量.  内存 - 工作集增量:进程所使用的工作集内存 ...

  3. CF1175E Minimal Segment Cover 题解

    题意:给出\(n\)个形如\([l,r]\)的线段.\(m\)次询问,每次询问区间\([x,y]\),问至少选出几条线段,使得区间\([x,y]\)的任何一个部位都被至少一条线段覆盖. 首先有一个显然 ...

  4. one jar(转)

    http://blog.csdn.net/kabini/article/details/1598827

  5. 小程序video置顶

    page { overflow-y: none; height: 100vh; } .page__hd_media { position: fixed; width:100vw; top:; heig ...

  6. C# 基础之类与结构体的区别

    1.语法上的区别是: 定义类使用关键字class,定义结构体用关键字struct 2.结构体中不可对声明字段进行初始化,但类可以 3. 类:如果没有为类显示的定义一个构造函数,c#编译器会自动生成一个 ...

  7. Codeforces Round #532(Div. 2) A.Roman and Browser

    链接:https://codeforces.com/contest/1100/problem/A 题意: 给定n,k. 给定一串由正负1组成的数. 任选b,c = b + i*k(i为任意整数).将c ...

  8. Codeforces Round #533(Div. 2) B.Zuhair and Strings

    链接:https://codeforces.com/contest/1105/problem/B 题意: 给一个字符串和k,连续k个相同的字符,可使等级x加1, 例:8 2 aaacaabb 则有aa ...

  9. 118 Pascal's Triangle 帕斯卡三角形 杨辉三角形

    给定 numRows, 生成帕斯卡三角形的前 numRows 行.例如, 给定 numRows = 5,返回[     [1],    [1,1],   [1,2,1],  [1,3,3,1], [1 ...

  10. Windows下打开某些软件时显示显卡驱动不是最新的问题

    在Windows下打开某些对显卡要求比较高的软件时,会出现某些显卡驱动不是最新,要求更新到最新的提示,但是当你真的去更新显卡驱动的时候,却发现现在的显卡驱动已经是最新了,那么为什么还会有这样的提示呢, ...