在asp.net中找不到图像控件 [英] image control not found in asp.net

查看:95
本文介绍了在asp.net中找不到图像控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想访问图像按钮..但是以下行不会返回任何内容..这是正确与否?

ImageControlList()是按钮控件的集合



Dim fileDownloadimgBtn As ImageButton = CType(Page.Form.FindControl(ImageControlList(i)。 ID),ImageButton)

I want to access the image button.. but following line doesnt return anything.. This is correct or not???
ImageControlList() is collection of button control

Dim fileDownloadimgBtn As ImageButton = CType(Page.Form.FindControl(ImageControlList(i).ID), ImageButton)

推荐答案

ImageButton是您表单的子项,还是包含在另一个控件中?如果它是另一个控件的子项,那么您将无法使用该调用直接获取它。您需要从父控件而不是表单执行FindControl。
Is the ImageButton a child of your form, or is it contained in another control? If it is a child of another control then you will not be able to get it directly using that call. You will need to do FindControl from the parent control rather than the form.


这篇关于在asp.net中找不到图像控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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