<%@ Page Language="VB" AutoEventWireup="false" CodeFile="HiddenFieldDemo.aspx.vb" Inherits="HiddenFieldDemo" %>

<!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>Przykład użycia kontrolki HiddenField</title>
</head>
<body>
   <script type="text/javascript" language="javascript">    
      function ChangeHiddenValue()    
      {       
         alert("Wprowadzanie wartości ChangeHiddenValue");         
         var hdnId = "<%=hdnSecretValue.ClientID%>";       
         var hdn = document.getElementById(hdnId);         
         var txt = document.getElementById("txtSecretValue");         
         hdn.value = txt.value;       
         alert("Wartość została zmieniona");    
      } 
   </script>

   <form id="form1" runat="server">
   <div>
      <asp:HiddenField ID="hdnSecretValue" runat="server" 
         onvaluechanged="hdnSecretValue_ValueChanged" />
      Enter secret value:
      <asp:TextBox ID="txtSecretValue" runat="server"></asp:TextBox>
      <br />
      <br />
      <input id="Button1" type="button" value="button" onclick="ChangeHiddenValue()" />
      <asp:Button ID="btnPost" runat="server" Text="Odśwież" />
      <br />
      <br />
      <asp:Label ID="lblSecretValue" runat="server" Text=""></asp:Label>
   </div>
   </form>
</body>
</html>
