views:

30

answers:

2

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?

A: 

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.

Alsciende
I used ModalPopupExtender of AjaxToolKit. I have no idea of how to go with myIframe.currentDocument.
Ok you don't know about iframes, and I don't know about .net. But you can find out.
Alsciende
A: 

Can't you just use something like:

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

?

Protector one