protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
Customer obj = (Customer)Session["USER"];
Label label = e.Row.FindControl("customerId") as Label;
string str = label.Text;
if (obj != null)
{
if (str.Trim() != obj.CustomerId.ToString().Trim())
{
((LinkButton)e.Row.FindControl("LinkButton1")).Visible = false;
}
}
Label label = e.Row.FindControl("customerId") as Label能不能获取到customerId的值?
{
Customer obj = (Customer)Session["USER"];
Label label = e.Row.FindControl("customerId") as Label;
string str = label.Text;
if (obj != null)
{
if (str.Trim() != obj.CustomerId.ToString().Trim())
{
((LinkButton)e.Row.FindControl("LinkButton1")).Visible = false;
}
}
Label label = e.Row.FindControl("customerId") as Label能不能获取到customerId的值?
解决方案 »
- (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接)
- Jquery 选中多少个input CheckBox问题,IE正常,FF和Chrome无法取到值
- 网页中如何实现象Excel那样的表格?
- Rich文本是什么格式,大家给个例子,顶都有分
- SqlDataReader循环中如果执行更新程序就出错,进来看下吧。高手
- JS 如何规定文本框只可以是 英文和数字的混合,其他的都不允许
- objectDataSource & DataSourceId 数据邦定?
- 有关命名空间的引用,求救啊
- 请教 博客系统的Url重写
- 这个小问题请大家来解决!!!!
- 关于MVC
- datalist绑定图片,有请孟子,或高手请进
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label l= (Label)e.Row.FindControl("Label1");
Customer obj = (Customer)Session["USER"];
if (obj != null)
{
if(!l.Text.Equals(obj.CustomerId.ToString()){}
}
}
}
或Visible="<%# GetVisible(Eval("id"))%>