1. javascript function

<script language=”javascript”>
function SayHello()
{
alert(“Hello from JavaScript, invoked by Silverlight”);
}
</script>

2. .xaml

<Grid x:Name=”LayoutRoot” Background=”White”>
<Button x:Name=”btnSayHello” Content=”Say Hello”
Click=”btnSayHello_Click”></Button>
</Grid>

3. .xaml.cs

private void btnSayHello_Click(object sender, RoutedEventArgs e)
{
HtmlPage.Window.Invoke(“SayHello”);
}

4.  include HtmlPage class

using System.Windows.Browser;