<%@ 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 type="text/javascript">
  function validateForm() {
    var textbox = $get("TextBox1").control;
    return !(textbox.get_isInvalid());
  }
  </script>
</head>
<body>
  <form id="form1" runat="server" onsubmit="return validateForm();">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
      <Scripts>
        <asp:ScriptReference Name="PreviewScript.js" Assembly="Microsoft.Web.Preview" />
      </Scripts>
    </asp:ScriptManager>
    <div>
      <input type="text" id="TextBox1" />
      <span id="Error1" style="color: red;">*</span>
      <br />
      <input type="submit" />
    </div>
  </form>
  <script type="text/xml-script">
    <page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
      <components>
        <textBox id="TextBox1">
          <validators>
            <requiredFieldValidator errorMessage="** brak wartości w polu TextBox1" />
          </validators>
        </textBox>
        <validationErrorLabel id="Error1" associatedControl="TextBox1" />
      </components>
    </page>
  </script>
</body>
</html>
