<%@ 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>

  <script language="JavaScript" type="text/javascript">
  var label;
  var select;

  function pageLoad() {
    label = new Sys.Preview.UI.Label($get("Label1"));
    select = new Sys.Preview.UI.Selector($get("Select1"));

    // Sprawdzanie zaznaczonej wartości co sekundę.
    window.setInterval(
      function() {
        label.set_text(select.get_selectedValue());
      },
      1000);
  }
  </script>

</head>
<body>
  <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
      <Scripts>
        <asp:ScriptReference Assembly="Microsoft.Web.Preview" Name="PreviewScript.js" />
      </Scripts>
    </asp:ScriptManager>
    <div>
      <select id="Select1" size="3">
        <option value="1">jeden</option>
        <option value="2">dwa</option>
        <option value="3">trzy</option>
      </select><br />
      Wybrana wartość: <label id="Label1"></label>
    </div>
  </form>
</body>
</html>
