日期:2014-05-17 浏览次数:20480 次
str.Append("<li><asp:LinkButton ID=\"lnk_favourite\" runat=\"server\" CommandArgument=\"" + dt.Rows[i]["user_ID"].ToString() + "\" onclick=\"lnk_favourite_Click\" OnClientClick=\"return confirm('确定进行收藏?');\">加入收藏</asp:LinkButton></li>");
protected void lnk_favourite_Command(object sender, CommandEventArgs e)
{
//protected void lnk_favourite_Click(object sender, EventArgs e)
//{
string bID = ((LinkButton)sender).CommandArgument;//得到被收藏人的ID
int sID = 0;
if (Request.Cookies["user_ID"] != null)
{
sID = Convert.ToInt32(Request.Cookies["user_ID"].Value.ToString());
}
KKModle_Model.Kk_Favourite fav = new KKModle_Model.Kk_Favourite();
fav.fav_ID = 0;
fav.bID = Convert.ToInt32(bID);
fav.sID = sID;
int res = favBLL.favguanli(fav, 1);
if (res > 0)
{
co.dialog(this, "收藏成功!");
return;
}
}