The page I want to access the grid from is also an asp.net page, so it
doesn't have to be clientside access; in fact, it *shouldn't* be
because I need to pass the selected items from the grid to another .net
method running on the server. So I guess the question is, from within
an asp.net page, can I access a datagrid in an asp.net custom control
on a different asp.net page, which sits within an iframe within a third
asp.net page?
Put like that, it sounds rather hopeless.
I know that iframes are a pain to work with; unfortunately it's a
project that I've inherited so I don't have much choice. Thanks for
the links, they might not help to solve this problem but they should
help me understand iframes better!
John Timney ( MVP ) wrote:
You can talk between pages and compontents using javascript at the client
side, as long as you dont subject the browser to a cross site scripting
attack which is what normally happens when communciating between iframes.
Theres a good example of talking to an iframe from within a page here that
should get you started.
http://www.dyn-web.com/dhtml/iframes/
You cant talk to a iframes content if its not from the same domain, only to
the iframe object.
See:
http://msdn.microsoft.com/workshop/a...g_security.asp
iFrames are a pain to work with, you might be better off using divs.
--
Regards
John Timney
ASP.NET MVP
Microsoft Regional Director
"CJ" <cj*****@mail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...I have a page with a bunch of iframes (which make up a tab control).
At least one of these iframes contains an aspx page, which in turn
contains a .ascx component. This component then contains a datagrid.
Is there any way that I can access this datagrid from one of the other
iframes? The grid contains a template column containing checkboxes, and
I need to access the rows for which the checkbox is selected from this
other iframe. Since it's a templatecolumn, I can't just put the
underlying dataset in the session state and retrieve it from the other
page; I *could* maintain a second dataset containing just the selected
rows, which I update whenever a checkbox's state changes, but that just
seems incredibly slow and clumsy.
Is there any way I can do this?