温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:小范企业管理源码
当前文件路径:XiaoFanWeb/admin/news_type_Admin.aspx

1<%@ Page Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="news_type_Admin.aspx.cs" Inherits="admin_news_type_Admin" Title="Untitled Page" %> 2
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> 3
</asp:Content> 4
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> 5
<table width="500" style="height: 282px"> 6
<tr> 7
<td> 8
<asp:AccessDataSource ID="typeSource1" runat="server" DataFile="~/App_Data/dbs.mdb" 9
DeleteCommand="DELETE FROM [FZ_News_Type] WHERE [Id] = ?" InsertCommand="INSERT INTO [FZ_News_Type] ([Id], [Name], [Ord], [Pid]) VALUES (?, ?, ?, ?)" 10
SelectCommand="SELECT * FROM [FZ_News_Type] WHERE ([Pid] = ?) ORDER BY [Ord]" 11
UpdateCommand="UPDATE [FZ_News_Type] SET [Name] = ?, [Ord] = ?, [Pid] = ? WHERE [Id] = ?"> 12
<DeleteParameters> 13
<asp:Parameter Name="Id" Type="Int32" /> 14
</DeleteParameters> 15
<UpdateParameters> 16
<asp:Parameter Name="Name" Type="String" /> 17
<asp:Parameter Name="Ord" Type="Int32" /> 18
<asp:Parameter Name="Pid" Type="Int32" /> 19
<asp:Parameter Name="Id" Type="Int32" /> 20
</UpdateParameters> 21
<SelectParameters> 22
<asp:Parameter DefaultValue="0" Name="Pid" Type="Int32" /> 23
</SelectParameters> 24
<InsertParameters> 25
<asp:Parameter Name="Id" Type="Int32" /> 26
<asp:Parameter Name="Name" Type="String" /> 27
<asp:Parameter Name="Ord" Type="Int32" /> 28
<asp:Parameter Name="Pid" Type="Int32" /> 29
</InsertParameters> 30
</asp:AccessDataSource> 31
一级分类 32
<asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" 33
DataKeyNames="Id" DataSourceID="typeSource1" Width="500px" CellPadding="4" ForeColor="#333333" GridLines="None"> 34
<FooterStyle Width="500px" BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /> 35
<EmptyDataRowStyle Width="500px" /> 36
<Columns> 37
<asp:BoundField DataField="Id" HeaderText="编号" InsertVisible="False" ReadOnly="True" 38
SortExpression="Id" /> 39
<asp:BoundField DataField="Pid" HeaderText="分类" SortExpression="Pid" /> 40
<asp:BoundField DataField="Name" HeaderText="名称" SortExpression="Name" /> 41
<asp:BoundField DataField="Ord" HeaderText="排序" SortExpression="Ord" /> 42
<asp:TemplateField HeaderText="操作" ShowHeader="False"> 43
<EditItemTemplate> 44
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update" 45
Text="更新"></asp:LinkButton> 46
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" 47
Text="取消"></asp:LinkButton> 48
</EditItemTemplate> 49
<ItemTemplate> 50
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit" 51
Text="编辑"></asp:LinkButton> 52
<asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandName="Delete" 53
Text="删除"></asp:LinkButton> 54
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Select" 55
OnClick="LinkButton2_Click" Text="查看二级分类"></asp:LinkButton> 56
</ItemTemplate> 57
</asp:TemplateField> 58
</Columns> 59
<RowStyle Width="500px" BackColor="#E3EAEB" /> 60
<EditRowStyle Width="500px" BackColor="#7C6F57" /> 61
<SelectedRowStyle Width="500px" BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" /> 62
<PagerStyle Width="500px" BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /> 63
<HeaderStyle Width="500px" BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /> 64
<AlternatingRowStyle Width="500px" Wrap="True" BackColor="White" /> 65
</asp:GridView> 66
<hr /> 67
</td> 68
</tr> 69
<tr> 70
<td style="height: 143px" valign="top"> 71
<asp:AccessDataSource ID="typeSource2" runat="server" DataFile="~/App_Data/dbs.mdb" 72
DeleteCommand="DELETE FROM [FZ_News_Type] WHERE [Id] = ?" InsertCommand="INSERT INTO [FZ_News_Type] ([Id], [Name], [Ord], [Pid]) VALUES (?, ?, ?, ?)" 73
SelectCommand="SELECT * FROM [FZ_News_Type] WHERE ([Pid] = ?) ORDER BY [Ord], [Id]" 74
UpdateCommand="UPDATE [FZ_News_Type] SET [Name] = ?, [Ord] = ?, [Pid] = ? WHERE [Id] = ?"> 75
<DeleteParameters> 76
<asp:Parameter Name="Id" Type="Int32" /> 77
</DeleteParameters> 78
<UpdateParameters> 79
<asp:Parameter Name="Name" Type="String" /> 80
<asp:Parameter Name="Ord" Type="Int32" /> 81
<asp:Parameter Name="Pid" Type="Int32" /> 82
<asp:Parameter Name="Id" Type="Int32" /> 83
</UpdateParameters> 84
<SelectParameters> 85
<asp:ControlParameter ControlID="GridView1" Name="Pid" PropertyName="SelectedValue" 86
Type="Int32" /> 87
</SelectParameters> 88
<InsertParameters> 89
<asp:Parameter Name="Id" Type="Int32" /> 90
<asp:Parameter Name="Name" Type="String" /> 91
<asp:Parameter Name="Ord" Type="Int32" /> 92
<asp:Parameter Name="Pid" Type="Int32" /> 93
</InsertParameters> 94
</asp:AccessDataSource> 95
<asp:Label ID="Label1" runat="server" ForeColor="Red" Text="二级分类" Visible="False"></asp:Label> 96
<asp:GridView ID="GridView2" runat="server" AllowSorting="True" AutoGenerateColumns="False" 97
DataKeyNames="Id" DataSourceID="typeSource2" Width="400px" CellPadding="4" ForeColor="#333333" GridLines="None"> 98
<FooterStyle Width="400px" BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /> 99
<EmptyDataRowStyle Width="400px" /> 100
<Columns> 101
<asp:BoundField DataField="Id" HeaderText="编号" InsertVisible="False" ReadOnly="True" 102
SortExpression="Id" /> 103
<asp:BoundField DataField="Name" HeaderText="名称" SortExpression="Name" /> 104
<asp:BoundField DataField="Ord" HeaderText="排序" SortExpression="Ord" /> 105
<asp:CommandField HeaderText="操作" ShowDeleteButton="True" ShowEditButton="True" /> 106
</Columns> 107
<RowStyle Width="400px" BackColor="#E3EAEB" /> 108
<EditRowStyle Width="400px" BackColor="#7C6F57" /> 109
<SelectedRowStyle Width="400px" BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" /> 110
<PagerStyle Width="400px" BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /> 111
<HeaderStyle Width="400px" BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /> 112
<AlternatingRowStyle Width="400px" BackColor="White" /> 113
</asp:GridView> 114
</td> 115
</tr> 116
</table> 117
</asp:Content> 118
119




