首页 > 代码库 > asp.net控件循环变色
asp.net控件循环变色
protected void lbtnState_Click(object sender, EventArgs e)
{
foreach (var item in div_state.Controls)
{
if (item is LinkButton)
{
(item as LinkButton).ForeColor = System.Drawing.Color.Black;
if (sender is LinkButton)
{
LinkButton btn = (LinkButton)sender;
if (btn.CommandName == "all")
{
DTcms.Common.Utils.WriteCookie("Rec_Res", "");
continue;
}
if (btn.CommandName == "success")
{
DTcms.Common.Utils.WriteCookie("Rec_Res", "true");
continue;
}
if (btn.CommandName == "wait")
{
DTcms.Common.Utils.WriteCookie("Rec_Res", "false");
continue;
}
}
}
}
(sender as LinkButton).ForeColor = System.Drawing.Color.Red;
ps.PageIndex = 1;
Bind_rpShow(ps);
}