对象refferncce未设置为objet的实例 [英] Object refferncce not set to an instance of an objet

查看:37
本文介绍了对象refferncce未设置为objet的实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

If e.Item.ItemType <> ListItemType.Header And ListItemType.Footer Then
               lblCopName = e.Item.FindControl("lblCopName")
               If sPacsName = lblCopName.Text Then
                   lblCopName.Text = '              '
               Else
                   sPacsName = lblCopName.Text
               End If
           End If
       Catch ex As Exception
           lblError.Text = ex.Message
       End Try

推荐答案

你的Lable控件'lblCopName'是NULL,这就是为什么它会出错。



所以请检查你传给FindControl方法的你的lbl id。





谢谢

AARIF SHAIKH
your Lable control 'lblCopName' is NULL , that's why it's through an error.

So please check your lbl id which you pass in to FindControl Method.


Thanks
AARIF SHAIKH


这篇关于对象refferncce未设置为objet的实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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