<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm_LinqDataSource.aspx.cs" Inherits="ToolsCRM.WebForm_LinqDataSource" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link rel="stylesheet" href="js/style.css" type="text/css" media="screen" />
    <title>Przykładowe dane</title>
    <style type="text/css">
        .auto-style1 {
            text-align: left;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div id="header">
	    <div id="logo">
		    <h1><a href="#">ToolsCRM</a></h1>
		    <p><a href="http://crm.dynamics.com/pl-pl/home">Microsoft Dynamics CRM</a></p>
	    </div>
        <div id="menu">
		<ul>
			<li class="current_page_item"><a href="#"></a></li>
			<li><a href="#"></a></li>
			<li><a href="#"></a></li>
			<li><a href="#"></a></li>
			<li class="last"><a href="#"></a>
                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Wyloguj" />
            </li>
		</ul>
	</div>
     </div>
        <div id="page">
          <div class="post">
            <div id="content">
                <div class="title">
				    <h2><a href="#">Przykładowe dane</a></h2>
			    </div>
                <div class="entry">
                    <!--This example lists all contacts from the Microsoft Dynamics CRM system. -->
                    <asp:LinqDataSource ID="Contacts" ContextTypeName="Xrm.XrmServiceContext" TableName="ContactSet" runat="server" />
                        <div class="auto-style1">
                    <asp:GridView ID="GridView1" DataSourceID="Contacts" AutoGenerateColumns="false" runat="server">
                 <Columns>
                <asp:TemplateField HeaderText="First Name">
                <ItemTemplate>
                    <asp:Label ID="Label1" Text='<%# Eval("firstname")%>' runat="server" />
                </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Last Name">
                 <ItemTemplate>
                <asp:Label ID="Label2" Text='<%# Eval("lastname")%>' runat="server" />
                  </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="City">
                <ItemTemplate>
                <asp:Label ID="Label3" Text='<%#Eval("address1_city") %>' runat="server" />
                </ItemTemplate>
                 </asp:TemplateField>
            </Columns>
            </asp:GridView>
            </div>
           </div>
          </div>
         </div>
       </div>
    </form>
</body>
</html>
