开发者

How to access a control inside an ajaxmodalpopup in javascript?

开发者 https://www.devze.com 2022-12-22 21:29 出处:网络
Inside an Ajax popup I have a GridView. I want to access the GridView from javascript. As it is inside popup I am unable to use document.getElementById

Inside an Ajax popup I have a GridView.

I want to access the GridView from javascript.

As it is inside popup I am unable to use document.getElementById

I used document.GetElementsByTagName and accessed popup in javascript.

How开发者_运维问答 to traverse to the gridview inside that popup?


Can't you just use something like:

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

?


If your "ajax popup" is a DOM iframe, use myIframe.contentDocument to get its DOM document.

Since you accessed the popup with document.getElementsByTagName, you obviously know the tagName of your popup. From there, you can use MSDN to find the way to access your popup's content.

0

精彩评论

暂无评论...
验证码 换一张
取 消