<%-- UsingAscx.aspx --%>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UsingAscx.aspx.cs" Inherits="UsingAscx" %>
<%@ Register Src="~/XamlButton.ascx" TagPrefix="xaml" TagName="Button" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
  <title>ASP.NET and Silverlight - Together!</title>
  <script type="text/javascript" src="js/silverlight.js"></script>
  <script type="text/xaml"id="theXaml"><?xml version="1.0"?>
    <Canvas xmlns="http://schemas.microsoft.com/client/2007"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Width="200" Height="200">
      <xaml:Button Name="button1" 
                   Text="Click Me" 
                   runat="server" />
      <xaml:Button Name="button2"
                   Text="Click me too"
                   Top="50" Left="50" 
                   Width="175" Height="35"
                   FontSize="18"
                   ClickHandler="button2_Clicked" 
                   runat="server" />
    </Canvas>      
  </script>
  <script type="text/javascript">
  function button2_Clicked(sender, args) {
    alert("button2 was clicked");
  }
  </script>
</head>
<body>
  <form id="form1" runat="server">
    <div id="theContainer">
      <script type="text/javascript">
        Silverlight.createObject(
          "#theXaml",                    
          document.getElementById("theContainer"), 
          "theHost",               
          { width: "250", height: "200", version: "0.9"},
          {});
      </script>
    </div>
  </form>
</body>
</html>
