(一)購物車全選的實現
其實沒什麼意義呀
只是為展示一個全選的實現
直接清空
請看(二)實現下清空購物車
先加個[全選]按鈕
<div>
<asp:LinkButton ID=
btn_checkall
runat=
server
onclick=
btn_checkall_Click
>全選</asp:LinkButton>
</div>
protected void btn_checkall_Click(object sender
EventArgs e)
{
if (dt
Rows
Count <
)
return;
for (int i =
; i < dt
Rows
Count; i++)
dt
Rows[i][
] = true;
this
Repeater
DataBind()
}
(二)實現下清空購物車
先加個[清空購物車]
protected void Button
_Click(object sender
EventArgs e)
{
if (Request
Cookies[
CarInfo
] == null)
{
return;
}
cok = Request
Cookies[
CarInfo
];
cok
Expires = DateTime
Now
AddDays(
)
Response
AppendCookie(cok)
}
From:http://tw.wingwit.com/Article/program/net/201311/11867.html