Silverlight and HTML interaction Overview

Source: Internet
Author: User

Silverlight contains some columns that can imitate Dom classes in HTML. These classes allow Silverlight to interact with HTML elements on the same interface. For example, read the value of a control, update a text value, or add a new element to the HTML page. These classes are all in the namespace system. Windows. Brower. There are several important classes below

Htmlpage

HtmlpageRepresents the entire HTML page hosted by Silverlight, which is the starting point of interaction with HTML. It provides HTML interaction (document attribute), browser Information Retrieval (browserinfo attribute), interaction with the current browser window (Windows attribute), and registration of the Silverlight method (registercreateabletype () that allows JavaScript to call () and registerscriptabletyp () method).

Browserinformation

 Provide some information about how to run SilverlightProgramBrowser information, including the browser name, version, and operating system. You can use the htmlpage. browserinfomattion attribute to obtain an instance of the browserinfomation class.

 Htmldocument

Htmldocument represents a complete HTML document. You can use the htmlpage. Document attribute to obtain an htmldocument instance that represents the current HTML page. You can use the htmldocument object to explore the structure and content of the page (including embedded elements of the htmlelement object ).

Htmlelement

Htmlelement can represent HTML elements in a page. You can use methods like setattribute () and setproperty () to operate these elements. Generally, the htmlelement object is obtained in the htmldocument object.

Htmlwindow

Htmlwindow represents a browser window, and provides some methods to jump to a new interface or to different parts of the same page. Generally, the htmlpage. Window attribute is used to obtain the htmlwindow class instance of the Silverlight host page.

Httputility

Httputility is a number of HTML-related tasks, including HTML encoding and decoding (making the text securely displayed on the page), URL encoding, and decoding (making the strings in the URL safe-for example, as a query string ).

Scriptabletypeattribute and scriptablememberattribute

These two classes allow you to expose some classes and methods that can be accessed by HTML Javascript in Silverlight.

Scriptobject

Scriptobject represents the JavaScript function defined on the page and allows this method to be called in the Silverlight program.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.