⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addnews.aspx

📁 一个实现新闻基本功能(文章添加、删改、列表、后台管理
💻 ASPX
字号:
<%@ Page Language="C#" AutoEventWireup="true" Inherits="News" Codebehind="AddNews.aspx.cs" %>

<!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">
<Link href=style.css rel=stylesheet />

    <title>添加新闻</title>
</head>
<body style="font-family: Times New Roman">
    <form id="form1" runat="server">
    <div align="center">
        <table border="0" cellpadding="0" cellspacing="0" style="border-right: #cccccc 1px solid;
            border-top: #cccccc 1px solid; border-left: #cccccc 1px solid; width: 760px;
            border-bottom: #cccccc 1px solid">
            <tr>
                <td bgcolor="#cccccc" style="height: 15px">
                    <a href="Class.aspx?Action=Add">栏目(添加)管理</a> --- --- --- <a href="AddNews.aspx?Action=Add"><span style="font-family: Times New Roman">
                        新闻(添加)管理</span></a> --- --- --- <a href="Class.aspx?Action=Logout"><span style="font-family: Times New Roman">
                            退出后台</span></a></td>
            </tr>
            <tr style="font-family: Times New Roman">
                <td style="height: 14px">
                    <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
                        <tr>
                            <td align="right" style="width: 157px; height: 24px">
                                标题:</td>
                            <td align="left" style="height: 24px">
                                <asp:TextBox ID="tbx_title" runat="server" Width="487px"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td align="right" style="width: 157px; height: 24px">
                                作者:</td>
                            <td align="left" style="height: 24px">
                                <asp:TextBox ID="tbx_author" runat="server"></asp:TextBox>
                                <asp:DropDownList ID="ddl_class" runat="server">
                                </asp:DropDownList>
                                <asp:Label ID="lbl_addtime" runat="server" Visible="False"></asp:Label></td>
                        </tr>
                        <tr>
                            <td align="right" style="width: 157px">
                                内容:</td>
                            <td align="left">
                                <asp:TextBox ID="tbx_content" runat="server" Height="149px" TextMode="MultiLine" Width="480px"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td align="right" style="width: 157px">
                            </td>
                            <td align="left">
                                <asp:Button ID="btn_value" runat="server" Text="Button" OnClick="Button1_Click" /></td>
                        </tr>
                    </table>
                    <asp:Label ID="message" runat="server" Font-Size="Small" ForeColor="Red" Visible="False"></asp:Label></td>
            </tr>
            <tr style="font-family: Times New Roman">
                <td style="height: 16px">
                    <asp:DataList ID="dl_class" runat="server" RepeatDirection="Horizontal" ShowFooter="False"
                        ShowHeader="False">
                        <ItemTemplate>
                            <a href='AddNews.aspx?classid=<%# DataBinder.Eval(Container.DataItem,"BigClassID") %>&Action=Add'><%# DataBinder.Eval(Container.DataItem,"BigClassName") %></a>
                        </ItemTemplate>
                    </asp:DataList></td>
            </tr>
            <tr style="font-family: Times New Roman">
                <td style="height: 15px">
                    <asp:GridView ID="gv_news" DataKeyNames="ID" runat="server" AutoGenerateColumns="False" CellPadding="4"
                        ForeColor="#333333" GridLines="None" Width="100%" OnRowDeleting="gv_news_RowDeleting">
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <Columns>
                            <asp:BoundField DataField="ID" HeaderText="编号" />
                            <asp:BoundField DataField="BigCLassName" HeaderText="类别" />
                            <asp:BoundField DataField="Title" HeaderText="标题" />
                            <asp:BoundField DataField="ReadCishu" HeaderText="阅读次数" />
                            <asp:HyperLinkField DataNavigateUrlFields="ID" DataNavigateUrlFormatString="AddNews.aspx?id={0}&Action=Edit"
                                HeaderText="编辑" Text="编辑" />
                            <asp:CommandField />
                            <asp:CommandField ShowDeleteButton="True" />
                        </Columns>
                        <RowStyle BackColor="#EFF3FB" />
                        <EditRowStyle BackColor="#2461BF" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                </td>
            </tr>
            <tr style="font-family: Times New Roman">
                <td bgcolor="#cccccc" style="height: 15px">
                    Copyright 北京瀛嘉科技发展有限责任公司</td>
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -