在DATAGRID中添加摸版列放入LABEL,假如LABEL的TEXT数据绑定的是数据库中某表的“ID”,这时,在DATAGRID外有一个BUTTON,单击事件中如何获得在DATAGRID中所有LABEL的TEXT值?
分虽然不多,不好意思,谢谢大家了!
分虽然不多,不好意思,谢谢大家了!
解决方案 »
- asp.net 怎么获取gridview某行的一个数据
- asp.net分类信息网站的一个功能
- 页面如何接收POST传来的值
- ExecuteNonQuery怎么样取返回影响的行数啊,
- dropdownlist控件的AUTOPOSTBACK设为true后,每次触发SelectedIndexChanged事件,页面刷新以后老是跳到top,能不能保持刷新前的位置不变
- 一个应用程序中的session是否只能在该应用程序的应用程序定义域中使用呢?
- *.ascx用户控件里面的按钮怎么激活它所对应的aspx文件里面的某个事件?
- dll文件用Xenocode进行混淆过了,如何反混淆过来?在线等
- 神啊,救救我吧!
- 请问一个有关模板列的问题
- 想把datagrid导出excel的代码做成一个类来调用,可不成功,请大家帮忙看看.
- 哪位高手能给我一个Paypal接口实例?
{
Label lbid = (Lable)dgi.FindControl("labelid");
if( lbid != null )
...
}
在RowCommand中
if (e.CommandName == "lId")
{
Response.Write(e.CommandArgument);
}
{
Label lbid = (Label)dgi.FindControl("LB4");
if( lbid != null )
{ Response.Write(lbid.Text); }
}
结果为:System.Web.UI.WebControls.Label不对啊!?
{ e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='red'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='silver'");
e.Row.Attributes.Add("onclick", "return confirm('Sure ?');");
e.Row.Cells[0].Attributes.Add("onclick", "return confirm('OK!');");
Label lb = (Label)e.Row.FindControl("Label1");
if (lb != null)
{
Response.Write(lb.Text);
}
Label lb2 = (Label)e.Row.FindControl("Label2");
if(lb2!=null)
{
Response.Write(lb2.Text); }
}
{
Label lbid = (Label)dgi.FindControl("LB4");
if( lbid != null )
{ Response.Write(lbid.Text); }
}好象取到不LABEL的值,打印不出来的