62,268
社区成员
发帖
与我相关
我的任务
分享
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "AddToBus")
{
string ID = this.GridView1.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString();
if (Session["bus"] == null)
{
Hashtable ht = new Hashtable();
ht.Add(ID, 1);
Session["bus"] = ht;
}
else
{
Hashtable ht = (Hashtable)Session["bus"];
if (ht[ID] == null)
{
ht[ID] = 1;
}
else
{
ht[ID] = (int)ht[ID] + 1;
}
}
}
}