温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:我的小书坊源码(三层实现)
当前文件:
MyBookShop/BookList.aspx,打开代码结构图
MyBookShop/BookList.aspx,打开代码结构图1<%@ Register TagPrefix="MyBookShop" TagName="HeaderMenu" Src="UserControls/HeaderMenu.ascx" %> 2
3
<%@ Page Language="c#" Inherits="MyBookShop.Web.BookList" CodeFile="BookList.aspx.cs" %> 4
5
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 6
<html xmlns="http://www.w3.org/1999/xhtml"> 7
<head id="Head1" runat="server"> 8
<title>浏览图书|-51aspx.com</title> 9
<link href="Styles/Style.css" rel="stylesheet" type="text/css" /> 10
</head> 11
<body> 12
<form id="Form1" method="post" runat="server"> 13
<table id="Table1" style="z-index: 101; left: 8px; width: 504px; position: absolute; 14
top: 8px; height: 208px" cellspacing="0" cellpadding="0" width="504" border="0"> 15
<tr> 16
<td align="center" colspan="4"> 17
<MyBookShop:HeaderMenu ID="headerMenu" runat="server"></MyBookShop:HeaderMenu> 18
</td> 19
</tr> 20
<tr> 21
<td style="width: 99px"> 22
>>浏览图书</td> 23
<td> 24
</td> 25
<td> 26
</td> 27
<td style="width: 45px"> 28
</td> 29
</tr> 30
<tr style="background-color: aqua"> 31
<td colspan="1" rowspan="1"> 32
※书名: 33
<asp:TextBox ID="TextBoxBookName" runat="server" Width="66px"></asp:TextBox></td> 34
<td style="height: 4px" colspan="1" rowspan="1"> 35
※类别: 36
<asp:DropDownList ID="DropDownListCategory" runat="server"> 37
</asp:DropDownList></td> 38
<td style="height: 4px"> 39
※排序: 40
<asp:DropDownList ID="DropDownListSortColumn" runat="server"> 41
<asp:ListItem Value="SaleCount">销量</asp:ListItem> 42
<asp:ListItem Value="PublishDate">出版日期</asp:ListItem> 43
<asp:ListItem Value="Price">价格</asp:ListItem> 44
</asp:DropDownList><asp:DropDownList ID="DropDownListSortType" runat="server"> 45
<asp:ListItem Value="Desc">递减</asp:ListItem> 46
<asp:ListItem Value="Asc">递增</asp:ListItem> 47
</asp:DropDownList></td> 48
<td> 49
<asp:Button ID="ButtonQuery" runat="server" Text="查询" Width="48px" OnClick="ButtonQuery_Click"> 50
</asp:Button></td> 51
</tr> 52
<tr> 53
<td align="center" colspan="4"> 54
<br> 55
<asp:GridView ID="GV" runat="server" AutoGenerateColumns="False" AllowPaging="True" 56
PageSize="5" OnPageIndexChanging="GV_PageIndexChanging"> 57
<Columns> 58
<asp:TemplateField> 59
<ItemTemplate> 60
<asp:CheckBox ID="chkSelected" Checked="False" Visible="True" GroupName="chk" runat="server"> 61
</asp:CheckBox></ItemTemplate> 62
</asp:TemplateField> 63
<asp:BoundField DataField="BookId" HeaderText="编号" /> 64
<asp:BoundField DataField="BookName" HeaderText="图书名" /> 65
<asp:BoundField DataField="Author" HeaderText="作者" /> 66
<asp:BoundField DataField="Publisher" HeaderText="出版社" /> 67
<asp:BoundField DataField="PublishDate" HeaderText="出版日期" DataFormatString="{0:yyyy-MM-dd}" /> 68
<asp:BoundField DataField="Price" HeaderText="价格" DataFormatString="{0:C}" /> 69
<asp:HyperLinkField HeaderText="详细信息" DataTextFormatString="详细信息" Text="详细信息" DataNavigateUrlFormatString="BookDetail.aspx?book_id={0}" 70
DataNavigateUrlFields="BookId" /> 71
</Columns> 72
</asp:GridView> 73
<asp:Label ID="LabelPageInfo" runat="server"></asp:Label></td> 74
</tr> 75
<tr style="background-color: aqua"> 76
<td align="left" style="background-color: aqua" colspan="2" rowspan="1"> 77
<asp:Button ID="ButtonDelete" runat="server" Text="删除" Width="48px" OnClick="ButtonDelete_Click"> 78
</asp:Button></td> 79
<td align="right" style="background-color: aqua" colspan="2" rowspan="1"> 80
把 81
<asp:TextBox ID="TextBoxAmount" runat="server" Width="26px">1</asp:TextBox>本选中的图书<asp:Button 82
ID="ButtonAdd2Cart" runat="server" Text="放入购物篮" OnClick="ButtonAdd2Cart_Click"></asp:Button></td> 83
</tr> 84
</table> 85
</form> 86
<a href="http://www.51aspx.com/CV/MyBookShop" target="_blank">download from 51aspx.com</a> 87
88
</body> 89
</html> 90



