如何在usercontrol中找到usercontrol的GridView控件 [英] How to find a GridView Control of a usercontrol inside usercontrol

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

问题描述





我有一个test.aspx文件,其中包含六个用户控件uc1实例,TagName是DASource,其ID为DASource1,DASource2,DASource3,DASource4 ,DASource5,DASource6以及页面上的其他控件。用户控件uc1包含另一个用户控件uc2,TagName是'DADimension'以及DropDown列表框ddl1和面板pnl1中的一些其他控件。用户控件uc2包含GridView gv1。



现在我的问题是,如何在页面test.aspx上使用javascript获取每个DASource的GridView gv1元素客户端事件'onchange'由ddl1触发。



我迫切需要解决方案。请帮忙。



谢谢和问候

Nirbhay

Hi,

I have a test.aspx file that contains six instance of user control uc1 that TagName is DASource as its id DASource1,DASource2,DASource3,DASource4,DASource5,DASource6 along with some other control on the page. The user control uc1 contains another user control uc2 that TagName is 'DADimension' along with a DropDown list box ddl1 and some other control inside a panel pnl1. The user control uc2 contains the GridView gv1.

Now my question is, how can I get the GridView gv1 element of each DASource using javascript on the page test.aspx when the client side event 'onchange' is fired by ddl1.

I need the solution very urgently. Please help.

Thanks & Regards
Nirbhay

推荐答案

您好Nirbhay ,



GridView是一个服务器端控件,JavaScript对GridView一无所知。此外,GridView在浏览器中呈现为表元素。所以你应该理想地在JavaScript中搜索table元素。



使用
Hi Nirbhay,

GridView is a server side control and JavaScript doesn't know anything about GridView. Moreover GridView is rendered as a table element in the browser. So you should be ideally searching for table element in JavaScript.

Use
document.getElementById('gv1')

查找JavaScript的方法表元素。

method of JavaScript to find the table element.


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

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