<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CustomerList.aspx.cs" Inherits="CustomerList"
                       EnableEventValidation="false" 
                       EnableViewState="false"  meta:resourcekey="Page1" Culture="auto" UICulture="auto"
                        %>
                        <%--Culture="auto" UICulture="auto"--%>
<%--<%@ OutputCache VaryByCustom="Culture" Duration="60" VaryByParam="none" %>                        --%>

<%@ Register Assembly="Westwind.Globalization" Namespace="Westwind.Globalization"
    TagPrefix="ww" %>
<%@ Register Assembly="Westwind.AjaxToolkit" Namespace="Westwind.Web.Controls" TagPrefix="ww" %>
<%@ Register Src="PopupCalendar.ascx" TagName="PopupCalendar" TagPrefix="uc2" %>
<%--<%@Register Src="~/ShowCode.ascx" TagPrefix="uc1" TagName="ShowCode" %> 
--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Northwind Customer List Ajax Localization Manager</title>
    <link href="../Westwind.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
        <h1><asp:Label runat="server" ID="lblPageHeader" meta:resourcekey="lblPageHeader" Text="Northwind Customer List"></asp:Label></h1>
        <asp:HyperLink runat="server" ID="lnkHome" NavigateUrl="~/default.aspx" Text="Home" meta:resourcekey="lnkHome" /> | 
        <asp:HyperLink runat="server" id="lnkPageRefresh" NavigateUrl="CustomerList.aspx" Text="Reset Page" meta:resourcekey="lnkPageRefresh"></asp:HyperLink> |
        <asp:LinkButton ID="lnkReloadData" runat="server" 
            Text="Reload Data" OnClick="lnkReloadData_Click"  meta:resourcekey="lnkReloadData"></asp:LinkButton>&nbsp;
        <small><asp:Label runat="Server" id="lblPageCreated" meta:resourcekey="lblPageCreated">Page created:</asp:Label>&nbsp;<%= DateTime.Now %></small>
        <br />
        <br />
        <small>Click any of the small icons to edit Localization Resources</small>
        <center>
          <table class="blackborder" style="background: #eeeeee; text-align:left; height: 459px;"
                cellpadding="0">
          <tr>
              <td colspan="2" class="gridheader" height="24">
               &nbsp;<asp:Label runat="server" ID="lblDialogTitle" meta:resourcekey="lblDialogTitle" Text="Customer List"></asp:Label>
              </td>
           </tr>
            <tr>
               <td valign="top" style="height: 435px">
                <asp:ListBox ID="lstCustomers" runat="server" Height="450px" Width="300px" 
                             OnSelectedIndexChanged="lstCustomers_SelectedIndexChanged" 
                             AutoPostBack="True" EnableViewState="False" meta:resourcekey="lstCustomers" >
                </asp:ListBox>
                </td>
                    <td valign="top" style="padding-left: 20px; padding-top: 10px; padding-right: 10px;
                        height: 435px;">
                        

        <asp:Panel runat="server" id="CustomerInfoPanel" meta:resourcekey="CustomerInfoPanel">
            <ww:wwErrorDisplay ID="ErrorDisplay" runat='server' DisplayTimeout="5000" UseFixedHeightWhenHiding="True" meta:resourcekey="ErrorDisplay" Width="400px">
            </ww:wwErrorDisplay>
                        <asp:HiddenField runat="server" ID="txtPK" Value="<%# this.Customer.Entity.Customerid %>"/>       
                        
                        <asp:Label ID="lblName" runat="server" Text="Name:" Width="263px" meta:resourcekey="lblName"></asp:Label><br />
                        <asp:TextBox ID="txtContactName" runat="server" Width="350px" Text="<%# this.Customer.Entity.Contactname %>" meta:resourcekey="txtContactName" ></asp:TextBox><br />
                        <br />
                        <asp:Label ID="lblCompany" runat="server" Text="Company:" meta:resourcekey="lblCompany"></asp:Label><br />
                        <asp:TextBox ID="txtCompany" runat="server" Width="350px" Text='<%# this.Customer.Entity.Companyname %>' meta:resourcekey="txtCompany"></asp:TextBox><br />
                        <br />
                        <asp:Label ID="lblAddress" runat="server" Text="Address:" meta:resourcekey="lblAddress"></asp:Label><br />
                        <asp:TextBox ID="txtAddress" runat="server" Width="350px" Height="35px" TextMode="MultiLine" Text="<%# this.Customer.Entity.Address %>" meta:resourcekey="txtAddress"></asp:TextBox><br />
                        <br />
                        <asp:Label ID="lblCity" runat="server" Text="City:" meta:resourcekey="lblCity"></asp:Label><br />
                        <asp:TextBox ID="txtCity" runat="server" Width="350px" Text="<%# this.Customer.Entity.City %>" meta:resourcekey="txtCity"></asp:TextBox><br />
                        <br />
                        <table>
                            <tr>
                                <td>
                                    <asp:Label ID="lblRegion" runat="server" Text="Region:" meta:resourcekey="lblRegion"></asp:Label><br />
                                    <asp:TextBox ID="txtRegion" runat="server" Width="74px" Text="<%# this.Customer.Entity.Region %>" meta:resourcekey="txtRegion"></asp:TextBox></td>
                                <td>
                                    &nbsp;&nbsp;<asp:Label ID="lblPostalCode" runat="server" Text="Postal Code:" meta:resourcekey="lblPostalCode"></asp:Label><br />
                                    &nbsp;&nbsp;<asp:TextBox ID="txtPostalCode" runat="server" Width="192px" Text="<%# this.Customer.Entity.Postalcode %>" meta:resourcekey="txtPostalCode"></asp:TextBox><br />
                                </td>
                            </tr>
                        </table>
                        <br />
                        <asp:Label ID="lblCountry" runat="server" Text="Country:" meta:resourcekey="lblCountry"></asp:Label><br />
                        <asp:TextBox ID="txtCountry" runat="server" Width="350px" Text="<%# this.Customer.Entity.Country %>" meta:resourcekey="txtCountry" /><br />
                        <br />
                        <asp:Label ID="lblEntered" runat="server" Text="Entered:" meta:resourcekey="lblEntered"></asp:Label>
                        <uc2:PopupCalendar ID="txtEntered" runat="server"   SelectedDate="<%# this.Customer.Entity.Entered %>"/>
                        <br />
                        <hr />
           </asp:Panel>

                        <asp:Button runat="server" ID="btnSave" Text=" Save Customer "  accesskey="S" style="width: 150px" OnClick="btnSave_Click" meta:resourcekey="btnSave" />
                        <asp:Button runat="server" ID="btnRefresh" Text=" Refresh List " style="width:150px;" meta:resourcekey="btnRefresh" />
                        
                   </td>
                </tr>
                <tr runat="server" >
                <td colspan="2" style="text-align:center" >
                 <hr />

                 <asp:GridView ID="dgOrders" runat="server" Width="90%" AutoGenerateColumns="False" 
                                         cssclass="blackborder" 
                                         EnableViewState="False"
                                          ShowFooter="True" cellpadding="2" meta:resourcekey="dgOrders">
                                          
                            <AlternatingRowStyle CssClass="gridalternate" />
                            <FooterStyle CssClass="gridheader" />
                            <HeaderStyle CssClass="gridheader" />
                            
                            <Columns>                                
                                <asp:BoundField  DataField="OrderDate" DataFormatString="{0:d}" HeaderText="Date" 
                                                 meta:resourcekey="BoundField" HtmlEncode="false">
                                    <headerstyle font-italic="False" font-overline="False" font-strikeout="False"
                                        font-underline="False" horizontalalign="Center" width="200px"/>
                                </asp:BoundField>
                                <asp:BoundField DataField="OrderId" HeaderText="Order Number" meta:resourcekey="BoundField1">
                                    <itemstyle  font-italic="False" font-overline="False" font-strikeout="False"
                                        font-underline="False" horizontalalign="Center" />
                                    <headerstyle font-italic="False" font-overline="False" font-strikeout="False"
                                        font-underline="False" horizontalalign="Center" width="200px" />
                                    <footerstyle horizontalalign="Right" />                                        
                                </asp:BoundField>
                                <asp:BoundField DataField="OrderTotal" DataFormatString="{0:n}" HeaderText="Order Total" meta:resourcekey="BoundField2">
                                    <itemstyle  horizontalalign="Right" />
                                    <headerstyle horizontalalign="Right" />
                                    <footerstyle horizontalalign="Right" />
                                </asp:BoundField>
                            </Columns>
                  </asp:GridView>

                </td>
                </tr>
                            
            </table>
            </center>
            
   <ww:wwDbResourceControl ID="Localizer" runat="server" meta:resourcekey="Localizer" CssClass="errordisplay" >
   </ww:wwDbResourceControl>    
        <br />
        <hr />
        <div style="font-size:8pt;padding-left:20px;padding-left:20px;padding-top:10px">
        This example shows a localizable form. The form is localized in English and German (try setting your browser's
        language to German). The presence of the 'Localizations Options' control on the bottom of the 
        page causes this page to show localization icons next to each localizable control. Clicking on any of these
        icons or the 'Edit Page Resources' link causes another form to pop up that allows editing the resources on
        this page (and any other pages that are set up for ASP.NET localization).
        <br />
        <br />
        The actual Localization form is mostly AJAX driven using the wwHoverPanel's wwMethodCallback control to make
        small requests from the client to the server. This allows the administration form to be very responsive and
        update many portions of the page interactively. The Admin form also demonstrates a number of the wwHoverPanel
        JavaScript features.  
        <br />
        <br />
        Note that the globalization provider is smart enough to differentiate page controls and user controls and
        jumps you to the appropriate resource. Also please note that on successive clicks on resources the Admin
        form does not pop to the top.
        <br />
        <br />
        This text 'content' is not localized. My German isn't good enough for it :-}...
        </div>
        <hr />
        </form>
</body>
</html>

