这是后台管理页面Code
<% @ Page Language = " C# " MasterPageFile = " ~/admin/MasterPage.master " validateRequest = false Title = " Untitled Page " AutoEventWireup = " true " CodeFile = " Admin_News.aspx.cs " Inherits = " admin_news " %> <% @ Register Assembly = " FreeTextBox " Namespace = " FreeTextBoxControls " TagPrefix = " FTB " %> < asp:Content ID = " Content2 " ContentPlaceHolderID = " body " Runat = " Server " > < div class = " admin_td_title " > 新闻列表管理 </ div > < asp:datagrid id = " DataGrid1 " CssClass = " datalist " runat = " server " PageSize = " 15 " CellPadding = " 3 " AllowPaging = " True " AllowSorting = " True " AutoGenerateColumns = " False " DataKeyField = " news_id " OnPageIndexChanged = " DataGrid1_PageIndexChanged " OnItemCommand = " DataGrid1_ItemCommand " > < Columns > < asp:TemplateColumn HeaderText = " 操作 " > < ItemStyle Width = " 30px " /> < ItemTemplate > < asp:LinkButton id = " LinkButton1 " runat = " server " CommandName = " edit " > 查看 </ asp:LinkButton > </ ItemTemplate > </ asp:TemplateColumn > < asp:BoundColumn DataField = " news_id " HeaderText = " ID " > < ItemStyle Width = " 30px " ></ ItemStyle > </ asp:BoundColumn > < asp:BoundColumn DataField = " news_title " HeaderText = " 新闻标题 " > < ItemStyle HorizontalAlign = " Left " /> </ asp:BoundColumn > < asp:TemplateColumn HeaderText = " 选择 " > < ItemStyle Width = " 30px " /> < ItemTemplate > < asp:CheckBox ID = " Chkall " runat = " server " /> </ ItemTemplate > </ asp:TemplateColumn > </ Columns > < PagerStyle Mode = " NumericPages " ></ PagerStyle > < HeaderStyle CssClass = " gridHeader " /> < ItemStyle CssClass = " gridbody " /> </ asp:datagrid > < div class = " table_foot " > < asp:button id = " BTadd " ValidationGroup = flase CssClass = " button " Text = " 增加 " runat = " server " OnClick = " BTadd_Click " ></ asp:button > < asp:button id = " Btall " CssClass = " button " Text = " 全选 " runat = " server " OnClick = " Btall_Click " ></ asp:button > < asp:button id = " Btdel " CssClass = " button " Text = " 删除 " runat = " server " OnClick = " Btdel_Click " ></ asp:button > </ div > < asp:Panel ID = " PNadd " runat = " server " Visible = " False " CssClass = " gridbody " > < TABLE id = " Table6 " width = " 100% " runat = " server " > < TR > < TD > 作者 / 来源: < asp:textbox cssClass = " textarea " id = " tbauth " runat = " server " ></ asp:textbox > < asp:RequiredFieldValidator id = " RFV1 " runat = " server " ControlToValidate = " tbauth " ErrorMessage = " 请填写作者! " ></ asp:RequiredFieldValidator > 新闻标题: < asp:textbox cssClass = " textarea " id = " tbtitle " runat = " server " ></ asp:textbox > < asp:RequiredFieldValidator id = " RVF3 " runat = " server " ControlToValidate = " tbtitle " ErrorMessage = " 请填写标题! " ></ asp:RequiredFieldValidator >< asp:Literal ID = " lbdate " runat = " server " ></ asp:Literal ></ TD > </ TR > < TR > < TD > < FTB:FreeTextBox Width = " 770px " Height = " 300px " ID = " FTBbody " runat = " server " HelperFilesPath = " HelperScripts// " ButtonPath = " HelperScripts/ftb/office2003/ " > </ FTB:FreeTextBox > </ TD > </ TR > < TR > < TD > < asp:RequiredFieldValidator id = " RFV4 " runat = " server " ControlToValidate = " FTBbody " ErrorMessage = " 请填写内容! " ></ asp:RequiredFieldValidator > < asp:Button ID = " Btedittrue " runat = " server " CssClass = " button " Text = " 确定修改 " OnClick = " Btedittrue_Click " /> < asp:Button id = " BTtrue " runat = " server " Text = " 确定增加 " CssClass = " button " OnClick = " BTtrue_Click " /> </ TD > </ TR > </ TABLE > </ asp:Panel > </ asp:Content >这个页面主要展示了新闻功能控件:
一,展示数据库中的新闻数据,还有几个验证控件;
二,可以修改,添加,批量删除功能;
三,控件所用的CSS样式我就不写出来了;
