在更新面板中查找控件 [英] Find A control wihin a updatepanel

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

问题描述

我想在ASPxPageControl1中找到一个控件.
这个ASPxPageControl1存在于Updatepanel中
此Update面板位于asp页面中,而asp页面位于母版页面中

i want to find a control within a ASPxPageControl1 .
This ASPxPageControl1 present inside a Updatepanel
This Update panel present in a asp page who is present inside a Master page

推荐答案

在代码背后,您可以编写如下代码:
On the codebehind you can write code like this:
var foundcontrol1 = aspxPAgeControl1.FindControl("control ID Here");
//or use the ClientID property, but this does not make much sense since you already have the control
 var foundControl2  = aspxPAgeControl1.FindControl(control.ClientID);



在.aspx页面上,您可以使用javascript和:



on the .aspx page you can use javascript and:

document.getElementById('controlID')


但是由于您将不知道控件的名称,因此可以执行以下操作:


but since you wont know the name of the control upfront you can do :

document.getElementById('<%= control.ClientID %>')



希望对您有帮助



hope it helps


这篇关于在更新面板中查找控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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