Calling a JavaScript function from Silverlight 2

Published 26 March 08 12:30 AM | Laurent Duveau

Wow, this is far better now with SL2! no more tips and tricks.

BLOCKED SCRIPT

<script type="text/javascript">
function DisplayMessage()
{
    alert("call me from Silverlight 2");
}
</script>

Silverlight:

using System.Web.Browser;

HtmlPage.Window.CreateInstance("DisplayMessage");

Read the complete post at http://weblogs.asp.net/lduveau/archive/2008/03/26/calling-a-javascript-function-from-silverlight-2.aspx

Filed under: