<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
  <title>ASP.NET AJAX</title>
  <style type="text/css">
  .style1 { font-family: Monospace; border-style: dotted; color: #0f0; }
  .style2 { font-family: Sans-Serif; border-style: solid; color: #0ff; }
  </style>
</head>
<body>
  <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
      <Services>
        <asp:ServiceReference Path="RandomCssClass.asmx" />
      </Services>
      <Scripts>
        <asp:ScriptReference Name="PreviewScript.js" Assembly="Microsoft.Web.Preview" />
      </Scripts>
    </asp:ScriptManager>
    <div>
      <label id="Label1">Formatowanie tego tekstu zostanie zmienione</label>
    </div>
    <input type="button" id="Button1" value="Losowy styl" />
  </form>
    <script type="text/xml-script">
    <page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
      <components>
        <label id="Label1" />
        <button id="Button1">
          <click>
            <invokeMethodAction target="randomCssMethod" method="invoke">
              <parameters userContext="" />
            </invokeMethodAction>
          </click>
        </button>
        <serviceMethodRequest id="randomCssMethod"
                              url="RandomCssClass.asmx"
                              methodName="getRandomCssClass"
                              useGet="false">
          <completed>
            <setPropertyAction target="Label1"
                               property="element"
                               propertyKey="className">
              <bindings>
                <binding dataContext="randomCssMethod"
                         dataPath="result"
                         property="value" />
              </bindings>
            </setPropertyAction>
          </completed>
        </serviceMethodRequest>
      </components>
    </page>
  </script>
</body>
</html>
