EmployeeInfo.ascx 2.4 KB

123456789101112131415161718192021222324252627282930
  1. <!-- <Snippet2> -->
  2. <%@ Control Language="C#" AutoEventWireup="true" Inherits="UpdatePanelUserControl.EmployeeInfo" Codebehind="EmployeeInfo.ascx.cs" %>
  3. <asp:UpdatePanel ID="EmployeeInfoUpdatePanel" runat="server">
  4. <ContentTemplate>
  5. <asp:Label ID="LastUpdatedLabel" runat="server"></asp:Label>
  6. <asp:DetailsView ID="EmployeeDetailsView" runat="server" Height="50px" Width="410px" AutoGenerateRows="False" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataSourceID="EmployeeDataSource" ForeColor="Black" GridLines="None">
  7. <FooterStyle BackColor="Tan" />
  8. <EditRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
  9. <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
  10. <Fields>
  11. <asp:BoundField DataField="LastName" HeaderText="Last Name" SortExpression="LastName" />
  12. <asp:BoundField DataField="FirstName" HeaderText="First Name" SortExpression="FirstName" />
  13. <asp:BoundField DataField="EmailAddress" HeaderText="E-mail Address" SortExpression="EmailAddress" />
  14. <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />
  15. <asp:BoundField DataField="HireDate" HeaderText="Hire Date" SortExpression="HireDate" />
  16. <asp:BoundField DataField="VacationHours" HeaderText="Vacation Hours" SortExpression="VacationHours" />
  17. <asp:BoundField DataField="SickLeaveHours" HeaderText="Sick Leave Hours" SortExpression="SickLeaveHours" />
  18. </Fields>
  19. <HeaderStyle BackColor="Tan" Font-Bold="True" />
  20. <AlternatingRowStyle BackColor="PaleGoldenrod" />
  21. </asp:DetailsView>
  22. <asp:SqlDataSource ID="EmployeeDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString %>"
  23. SelectCommand="SELECT Person.Contact.LastName, Person.Contact.FirstName, Person.Contact.EmailAddress, Person.Contact.Phone, HumanResources.Employee.HireDate, HumanResources.Employee.VacationHours, HumanResources.Employee.SickLeaveHours FROM Person.Contact INNER JOIN HumanResources.Employee ON Person.Contact.ContactID = HumanResources.Employee.ContactID WHERE HumanResources.Employee.EmployeeID = @SelectedEmployeeID">
  24. <SelectParameters>
  25. <asp:Parameter Name="SelectedEmployeeID" />
  26. </SelectParameters>
  27. </asp:SqlDataSource>
  28. </ContentTemplate>
  29. </asp:UpdatePanel>
  30. <!-- </Snippet2> -->