Rico
Rico

Reputation: 1298

How to get Silverlight to access my HTML DOM

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.

Upvotes: 1

Views: 1190

Answers (2)

Denis
Denis

Reputation: 4115

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

Upvotes: 0

Muad'Dib
Muad'Dib

Reputation: 29216

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.

Upvotes: 2

Related Questions