做了一个,很简单,
hashcontrol.ascx.cs
-------------------------------------------------------------------------
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="hashcontrol.ascx.cs" Inherits="WebApplication1.hashcontrol" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<asp:TextBox id="tbSource" runat="server"></asp:TextBox>
<asp:Button id="btnSearch" runat="server" Text="Search"></asp:Button>
<asp:TextBox id="tbTarget" runat="server"></asp:TextBox>cs
-----------------------------------------------------------------
namespace WebApplication1
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Collections; /// <summary>
/// hashcontrol 的摘要说明。
/// </summary>
public class hashcontrol : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.TextBox tbSource;
protected System.Web.UI.WebControls.Button btnSearch;
protected System.Web.UI.WebControls.TextBox tbTarget; private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
} #region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器
/// 修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
this.Load += new System.EventHandler(this.Page_Load); }
#endregion private void btnSearch_Click(object sender, System.EventArgs e)
{
Hashtable data = (Hashtable)ViewState["data"];
if(data!= null && data.Contains(this.tbSource.Text))
{
this.tbTarget.Text = data[this.tbSource.Text].ToString();
}
}
public void SetData(Hashtable data)
{
ViewState["data"] = data;
}
}
}