<%@ Page Language="C#" AutoEventWireup="true" 
         CodeFile="ScriptVariables.aspx.cs" Inherits="ScriptVariablesPage" 
         MasterPageFile="~/TestMaster.master" %>
<asp:Content ContentPlaceHolderID="head" runat="server">
    <link href="WestWind.css" rel="stylesheet" type="text/css" />
    <script src="scripts/jquery.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ContentPlaceHolderID="Content" runat="server">
    <div>
    What's your name:
    <asp:TextBox runat="server" ID="txtName"></asp:TextBox>
        <asp:Button runat="server" ID="btnSubmit" Text="Say it" />
    </div>
    
    <div id="divMessage" class="errordisplay">
    </div>
    
    <asp:Panel runat="server" ID="panel1" class="errordisplay">
        <asp:TextBox runat="server" Text="Embedded Text" ID="txtPanelTextBox"></asp:TextBox>
    </asp:Panel>
    
    <asp:Repeater runat="server" ID="repList">
    <ItemTemplate>
        <asp:TextBox runat="server" ID="txtCompany"></asp:TextBox>
        <asp:TextBox runat="server" ID="txtAddress"></asp:TextBox>
    </ItemTemplate>
    </asp:Repeater>

    <asp:GridView runat="server" ID="gdvTest">
    <Columns>
        <asp:BoundField DataField="CustomerId" />
        <asp:BoundField DataField="CompanyName" />
    </Columns>
    </asp:GridView>

    <script type="text/javascript">
        

        jQuery("#divMessage").text(serverVars.name + " " + serverVars.company + " " + serverVars.counter + " " + serverVars.entered.toLocaleDateString());    
       
        
    </script>
<script type="text/javascript">
var txtName = document.getElementById(serverVars.txtNameId);
var name = jQuery("#" + serverVars.txtNameId).css("border","solid 1px red");

// *** Read values
var name = serverVars.name;
var entered = serverVars.entered;
var counter = serverVars.counter;

// *** Update Properties to be sent back to server
serverVars.entered = new Date();
serverVars.name = "Jimmy Johnston Jr.";

// *** Update _Items 'collection'
serverVars.add("Custom","Rick");
serverVars.add("CustomValue","West Wind");
serverVars.add("curDate",new Date(2001,10,1));




     

//]]>
</script>
</asp:Content>