views:

28

answers:

2

Basically I have a silverlight web App that resides within an IFrame. and that IFrame resides within a Frame of its own. And i want to access Buttons in the dom within the outer Frame.. Here is kind of a map of how it looks.

-My Application
   -Frame
      -Button
      -Iframe
         -Silverlight web wrapper
            -Silverlight

Can I and How do i get from the silverlight App all the way back up the dom to click that dang button?

Thanks for any help you can offer.

A: 

this should be pretty easy to do. You can directly access the DOM via HtmlPage.Document object:

HtmlDocument htmlDoc = HtmlPage.Document;

Make certain to first add a reference to the System.Windows.Browser namespace

here is more information. and here is the MSDN doc on HtmlDocument object.

Muad'Dib
Even though silverlight is nested within a iframe which is nested within another frame? How do i get out to the second parent object above?
Rico
it seems that under normal circumstances, the iframe has no access to its parent's DOM, but you can call javascript methods on said parent. so a workaround would be to create a javascript method that does the job, then call that from your silverlight. example at http://boyerblog.twistvc.com/read.php?eid=20
Muad'Dib
A: 

Check out this blog post: Accessing parent document from within nested iframes . I would guess that you will have to use javascript to accomplish you goal

Denis