如何在“详细信息"视图中找到控件,请帮助 [英] How to find the control in Detail view please help

查看:61
本文介绍了如何在“详细信息"视图中找到控件,请帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


请帮助我详细查看控件.

Hi
please help me to find the control in detail view.

Label compname = DetailsView1.Rows[1].Cells[0].FindControl("complbl");





 i am getting error us

"Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"



谢谢



Thanks

推荐答案

Label compname = (Label)DetailsView1.Rows[1].Celles[0].FindControl("complbl");



这是正确的语法,但错误指向其他来源.尝试这样做:



that is the right syntax, but the error is pointing to a different source. Try doing this one:

if(DetailsView1.Rows.Count != 0)
{
   Label compname = (Label)DetailsView1.Rows[1].Celles[0].FindControl("complbl");
}



问候,
爱德华



Regards,
Eduard


这篇关于如何在“详细信息"视图中找到控件,请帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆