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. [翻译] 正式宣布 .NET 5

    原文: Introducing .NET 5 今天,我们宣布 .NET Core 3.0 之后的下一个版本将是 .NET 5 .这将是 .NET 系列的下一个重要版本. 将来只会有一个 .NET ,您 ...

  2. dos生成目录树

    1. tree命令详解 [Tree命令作用] 以图形显示驱动器或路径的文件夹结构. [Tree命令格式] 在命令行窗口使用tree /?查看帮助. TREE [drive:][path] [/F] [ ...

  3. HDU4166【BFS】

    题意: 给你一幅图,给你起点和终点,再给你机器人所面对的方向,机器人可以左转90°,右转90°,向前进一格,每种操作都是1秒,,求起点和终点最少花费下的路径条数,方案数: 思路: 这里有一个不同就是机 ...

  4. caller和callee的解析与使用-型参与实参的访问

    caller:是一个函数引用(当前执行函数”被调用的地方”{即这个”被调用的地方”函数引用},如果这个”被调用的地方”是window,则返回[null]),是函数名的属性: var a = funct ...

  5. Android开发实践:掌握Camera的预览方向和拍照方向

    http://ticktick.blog.51cto.com/823160/1592267?utm_source=tuicool&utm_medium=referral Android的Cam ...

  6. Codevs 1312 连续自然数和

    1312 连续自然数和 题目描述 Description 对于一个自然数M,求出所有的连续的自然数段,使得这些连续自然数段的全部数字和为M.eg:1998+1999+2000+2001+2002=10 ...

  7. Java相关书籍阅读

  8. C# 中的构造函数与析构函数

    C# 中的构造函数 类的 构造函数 是类的一个特殊的成员函数,当创建类的新对象时执行. 构造函数的名称与类的名称完全相同,它没有任何返回类型. 下面的实例说明了构造函数的概念: using Syste ...

  9. 模拟IO 读写压力测试

    #### 本实验室通过创建一个测试表myTestTable ,分配在一个足够大小的表空间. ###然后通过 insert select 方式,创建100个后台进程进行读写操作,每个后台进程预计时间20 ...

  10. 通过Chrome执行watir-webdriver

    1.http://code.google.com/p/chromedriver/downloads/list  下载chromedriver驱动文件chromedriver.exe 2.把驱动文件放在 ...