<%@ Page Language="C#" AutoEventWireup="true" CodeFile="upd_data.aspx.cs" Inherits="upd_data" %>
<!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 runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<atlas:ScriptManager ID="SM1" runat="server" EnablePartialRendering="true"></atlas:ScriptManager>
<div>
<asp:TextBox ID="txtLNameSearch" runat="server" AutoPostBack="True"></asp:TextBox>
<asp:Button ID="btnSearch" runat="server" Text="Search" /></div>
<atlas:UpdateProgress ID="updateprogress1" runat="server">
<ProgressTemplate>
<div style="background-color:yellow">Searching database for matching records...</div>
</ProgressTemplate>
</atlas:UpdateProgress>
<atlas:UpdatePanel ID="up" runat="server" Mode="conditional" RenderMode="Inline">
<ContentTemplate>
<asp:GridView ID="gvEmp" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource2"
EmptyDataText="There are no data records to display.">
<Columns>
<asp:BoundField DataField="EmpId" HeaderText="Emp ID" ReadOnly="True" SortExpression="EmpId" />
<asp:BoundField DataField="FName" HeaderText="First Name" SortExpression="FName" />
<asp:BoundField DataField="LName" HeaderText="Last Name" SortExpression="LName" />
<asp:BoundField DataField="OfficePhone" HeaderText="Office Phone" SortExpression="OfficePhone" />
</Columns>
</asp:GridView>
</ContentTemplate>
<Triggers>
<atlas:ControlValueTrigger ControlID="txtLNameSearch" PropertyName="Text" />
</Triggers>
</atlas:UpdatePanel>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:HRConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:HRConnectionString1.ProviderName %>" SelectCommand="SELECT [EmpId], [FName], [LName], [OfficePhone] FROM [Emp] WHERE ([LName] LIKE '%' + @LName + '%')">
<SelectParameters>
<asp:ControlParameter ControlID="txtLNameSearch" Name="LName" PropertyName="Text" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</form>
</body>
</html>
|