日期:2014-05-17 浏览次数:20981 次
<%@ Page Language="C#" AutoEventWireup="true" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> public Hashtable ht = new Hashtable(); public System.Collections.Generic.Dictionary<String, String> ht2 = new System.Collections.Generic.Dictionary<string, string>(); protected void Page_Load(object sender, EventArgs e) { ht.Add("commonName", "功能1"); ht2.Add("commonName", "功能2"); ht["xx"] = "test1"; ht2["xx"] = "test2"; } </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>无标题页</title> </head> <body> <form id="form1" runat="server"> <%=ht["commonName"]%> <%=ht2["commonName"]%> <%=ht["xx"]%> <%=ht2["xx"]%> </form> </body> </html>
------解决方案--------------------
个人Dictionary用的比较多 给你个例子
http://www.cnblogs.com/linzheng/archive/2010/12/13/1904709.html