public partial class _Default : System.Web.UI.Page
{
public Hashtable chooses = new Hashtable();
protected void Page_Load(object sender, EventArgs e)
{ } protected void CheckBox1_click(object sender, EventArgs e)
{
CheckBox FindCheck = null;
Label FindLabel=null;
if (chooses.Count <= 5)
{
for(int i=0;i<DataList1.Items.Count-1;i++)
{
FindCheck = (CheckBox)DataList1.Items[i].FindControl("CheckBox1");
FindLabel=(Label)DataList1.Items[i].FindControl("temp");
if (FindCheck.Checked)
{
if (!chooses.ContainsValue(FindLabel.Text))
chooses.Add(FindCheck.Text, FindLabel.Text);
}
else
{
if (chooses.ContainsValue(FindLabel.Text))
chooses.Remove(FindCheck.Text);
}
}
}
}
protected void Send_Click(object sender, EventArgs e)
{
foreach (DictionaryEntry de in chooses)
{
Label1.Text += de.Key + "=" + de.Value + "</br>";
} }
}
{
public Hashtable chooses = new Hashtable();
protected void Page_Load(object sender, EventArgs e)
{ } protected void CheckBox1_click(object sender, EventArgs e)
{
CheckBox FindCheck = null;
Label FindLabel=null;
if (chooses.Count <= 5)
{
for(int i=0;i<DataList1.Items.Count-1;i++)
{
FindCheck = (CheckBox)DataList1.Items[i].FindControl("CheckBox1");
FindLabel=(Label)DataList1.Items[i].FindControl("temp");
if (FindCheck.Checked)
{
if (!chooses.ContainsValue(FindLabel.Text))
chooses.Add(FindCheck.Text, FindLabel.Text);
}
else
{
if (chooses.ContainsValue(FindLabel.Text))
chooses.Remove(FindCheck.Text);
}
}
}
}
protected void Send_Click(object sender, EventArgs e)
{
foreach (DictionaryEntry de in chooses)
{
Label1.Text += de.Key + "=" + de.Value + "</br>";
} }
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货