Share via


HTML Bridge: Interaction Between HTML and Managed Code

Microsoft Silverlight will reach end of support after October 2021. Learn more.

In Silverlight, the HTML Bridge is an integrated set of types and methods that enable you to do the following:

  • Expose complete managed types to JavaScript for scripting.

  • Expose individual methods of managed types to JavaScript for scripting.

  • Pass managed types as parameters to JavaScript functions and objects.

  • Return managed types from JavaScript.

  • Assign managed types as event handlers, which are callable from JavaScript.

  • Call JavaScript event handlers from managed types.

  • Control various security aspects of your Silverlight-based application.

In addition, the HTML Bridge provides managed containers for Document Object Model (DOM) elements such as window, document, and standard HTML elements.

NoteNote:

Silverlight for Windows Phone Silverlight for Windows Phone does not support the HTML Bridge feature.

In This Section