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的使用的更多相关文章
- C# KeyValuePair<TKey,TValue>的用法-转载
C# KeyValuePair<TKey,TValue>的用法.结构体,定义可设置或检索的键/值对.也就是说我们可以通过 它记录一个键/值对这样的值.比如我们想定义一个ID(int类型)和 ...
- C# winform key value型数据如何绑定ComBox (hashtable,keyvaluepair,dictionary )
cbUserAgent是一个combox ArrayList list = new ArrayList(); Dictionary<string, string> useragents = ...
- KeyValuePair
KeyValuePair用法(转)(2012-06-25 10:47:35) 转载▼ // 标签: keyvaluepair it KeyValuePair C# KeyValuePair< ...
- The default for KeyValuePair
if (getResult.Equals(new KeyValuePair<T,U>())) or this: if (getResult.Equals(default(KeyValueP ...
- Check if KeyValuePair exists with LINQ's FirstOrDefault
http://stackoverflow.com/questions/793897/check-if-keyvaluepair-exists-with-linqs-firstordefault 问题: ...
- C# KeyValuePair<TKey,TValue>与Container
KeyValuePair<TKey,TValue> KeyValuePair<TKey,TValue>是一个结构体,相当于C#一个Map类型的对象,可以通过它记录一个键/值对 ...
- KeyValuePair用法(转)
转载自:http://blog.sina.com.cn/s/blog_9741eba801016w61.html C# KeyValuePair<TKey,TValue>的用法.结构体,定 ...
- Unity3d中Dictionary和KeyValuePair的使用
using UnityEngine; using System.Collections; using System.Collections.Generic;public class test : Mo ...
- List<KeyValuePair<TKey,TValue>> 与 Dictionary<TKey,TValue> 不同
两者都可以通过 KeyValuePair<TKey,TValue> 进行遍历,并且两者可以相互转换: List<KeyValuePair<string,string>&g ...
- KeyValuePair 和 Dictionary 的关系和区别
KeyValuePair 和 Dictionary 的关系 1.KeyValuePair a.KeyValuePair 是一个结构体(struct): b.KeyValuePair ...
随机推荐
- 51nod1010【二分】
打表+二分 #include <bits/stdc++.h> using namespace std; typedef long long LL; const LL inf=1e18+10 ...
- bzoj 3559: [Ctsc2014]图的分割【最小生成树+并查集】
读题两小时系列-- 在读懂题意之后,发现M(c)就是c这块最大权割边也就是的最小生成树的最大权边的权值,所以整个问题都可以在MST的过程中解决(M和c都是跟着并查集变的) 不过不是真的最小生成树,是合 ...
- [Xcode 实际操作]八、网络与多线程-(20)时间控件Timer定时功能
目录:[Swift]Xcode实际操作 本文将演示时间控件Timer定时功能的使用. 在项目导航区,打开视图控制器的代码文件[ViewController.swift] import UIKit cl ...
- javascript的学习笔记---复习及学习
1.javascript包含三大部分(BOM,DOM,ECMAscript) ECMAscript:规定js的语法规范 BOM:Document Object Model 给我们提供了一套完整的操作页 ...
- JPA_day01
- VLAN-3-VLAN Trunk:ISL和802.1Q
(1)ISL和802.1Q概念 通过使用VLAN Trunk链路,设备可以通过一条链路发送去往多个vlan的流量.为了知道数据帧属于哪个vlan,发送方会添加原始以太网数据帧的头部,这 ...
- Codeforces Round #497 (Div. 2)B. Turn the Rectangles
Bryce1010模板 http://codeforces.com/contest/1008/problems #include <bits/stdc++.h> using namespa ...
- 详解JS作用域(一)
一.什么是作用域 存储和访问变量,是任何一种编程语言最基本的功能之一,变量存在哪里?程序需要时如何找到它?这些问题需要一套良好的规则来规范,这套规则,就成为作用域. 二.编译原理 js通常归类为解释语 ...
- [转]如何降低SQL Server 内存使用率
我的数据库服务器内存为8G,现在资源管理器显示内存用到5G,可以肯定是sql server数据库吃内存原因. MSSQL占用了太多的内存,而且还不断的增长:或者说已经设置了使用内存,可是它没有用到那么 ...
- TCP简单程序
服务器段: package com.dcz.socket; import java.io.IOException; import java.io.OutputStream; import java.n ...