0% found this document useful (0 votes)
15 views

File Ascx

Uploaded by

kjhgfdjhgfds
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

File Ascx

Uploaded by

kjhgfdjhgfds
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

File ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="timgia.ascx.cs" Inherits="timgia" %> <style type="text/css"> .style1 { width: 100%; } .style2 { width: 147px; } .style3 { width: 169px; } </style> <div> <table cellpadding="0" cellspacing="0" class="style1"> <tr> <td class="style2"> Gia tu: <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1" DataTextField="DonGia" DataValueField="DonGia"> </asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [DonGia] FROM [SACH]"></asp:SqlDataSource> </td> <td class="style3"> Gia den: <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource2" DataTextField="DonGia" DataValueField="DonGia"> </asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [DonGia] FROM [SACH]"></asp:SqlDataSource> </td> <td> <asp:Button ID="btnTim" runat="server" onclick="btnTim_Click" Text="Tim" /> </td> </tr> </table> </div>

File aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="timgia.aspx.cs" Inherits="timgia" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:DataList ID="DataList1" runat="server" DataKeyField="MaSach" DataSourceID="SqlDataSource1"> <ItemTemplate> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("MaSach", "~/CHITIETSACH.aspx?MS={0}") %>' Text='<%# Eval("TenSach") %>'></asp:HyperLink> <br /> <asp:Image ID="Image3" runat="server" ImageUrl='<%# "/img/" + Eval("Hinh") %>' /> <br /> <asp:Label ID="Label1" runat="server" Text='<%# Eval("DonGia") %>'></asp:Label> <br /> <br /> </ItemTemplate> </asp:DataList> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [SACH] WHERE (([DonGia] &gt;= @DonGia) AND ([DonGia] &lt;= @DonGia2))"> <SelectParameters> <asp:QueryStringParameter Name="DonGia" QueryStringField="giatu" Type="Int32" /> <asp:QueryStringParameter Name="DonGia2" QueryStringField="giaden" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"> </asp:Content>

You might also like