110,538
社区成员
发帖
与我相关
我的任务
分享
首先 我定义了一个全局的stringbuilder sb;
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if (e.CommandName == "addobj")
{
if (Request.Cookies[Session["id"].ToString()] != null)
{
HttpCookie c = Request.Cookies[Session["id"].ToString()];
sb.Append(c.Value);
sb.Append(e.CommandArgument.ToString());
Request.Cookies[Session["id"].ToString()].Value = sb.ToString();
}
else
{
HttpCookie c1 = new HttpCookie(Session["id"].ToString(), e.CommandArgument.ToString());
c1.Expires = DateTime.Now.AddDays(14);
Response.Cookies.Add(c1);
}
}
if (e.CommandName == "buy")
{ }
if (e.CommandName == "selectobj")
{
}
}