有人知道datalist里的按钮怎么通过SESSION来控制显示的么?

kamasaki1 2010-01-14 11:33:26
RT,请知道的举个例说明一下,感激不尽
...全文
43 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
mngzilin 2010-01-14
  • 打赏
  • 举报
回复
for(int i=0;i<DataList.Items.Count;i++)
{
Button bt=(Button)DataList.Items[i].FindControl("Button1");
bt.Visible=Session["Isok"].ToString()=="ok"?true:false;
}
teerhu 2010-01-14
  • 打赏
  • 举报
回复
1.dl_detail.Items[i].FindControl("btnid").Visible = (bool)Session["blValue"];


2.ItemDataBound事件中
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
e.Item.FindControl("btnid").Visible = (bool)Session["blValue"];
}
BaoShiqiang 2010-01-14
  • 打赏
  • 举报
回复

111,120

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧