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

📄 newsmanage.aspx

📁 新闻管理后台源码,包括添加,删除,修改新闻
💻 ASPX
字号:
<%@ Page Language="C#" MasterPageFile="~/GeneralUser.master" AutoEventWireup="true" EnableViewState ="false"  CodeFile="newsmanage.aspx.cs" Inherits="newsmanage" Title="新闻管理" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table>
        <tr>
            <td colspan="4">
                <asp:Image ID="Image1" runat="server" ImageUrl="~/images/mannews.png" /></td>
        </tr>
        <tr>
            <td style="width: 100px; height: 9px;">
                &nbsp; &nbsp;
                <asp:Label ID="Label1" runat="server" Font-Names="宋体" Font-Size="12px" Text="新闻检索"></asp:Label></td>
            <td style="width: 100px; height: 9px; font-size: 12px;">
                <asp:DropDownList ID="ddlCheck" runat="server" Width="127px" DataSourceID="SqlDataSource1" DataTextField="NEWSKEY" DataValueField="NEWSKEY" Font-Size="12px">
                </asp:DropDownList>&nbsp;
            </td>
            <td style="width: 100px; height: 9px; font-size: 12px;">
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:news_manageConnectionString2 %>"
                    SelectCommand="SELECT [NEWSKEY] FROM [t_News]"></asp:SqlDataSource>
            </td>
            <td style="width: 100px; height: 9px; font-size: 12px;">
                <asp:Button ID="btnCheck" runat="server" Font-Names="宋体" Font-Size="12px" Text="搜索" OnClick="btnCheck_Click" /></td>
        </tr>
    </table>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
        DataSourceID="SqlDataSource2" ForeColor="#333333" GridLines="None" Width="791px" Font-Size="12px" AllowPaging="True" AllowSorting="True" PageSize="5" DataKeyNames="新闻编号" OnRowCommand="GridView1_RowCommand" OnRowDeleting="GridView1_RowDeleting" OnRowDataBound="GridView1_RowDataBound">
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <Columns>
            <asp:BoundField DataField="新闻编号" HeaderText="新闻编号" InsertVisible="False" ReadOnly="True"
                SortExpression="新闻编号" />
            <asp:BoundField DataField="新闻标题" HeaderText="新闻标题" SortExpression="新闻标题" />
            <asp:BoundField DataField="所属类别" HeaderText="所属类别" SortExpression="所属类别" />
            <asp:BoundField DataField="发布时间" HeaderText="发布时间" SortExpression="发布时间" />
            <asp:BoundField DataField="新闻来源" HeaderText="新闻来源" SortExpression="新闻来源" />
            <asp:BoundField DataField="用户名称" HeaderText="用户名称" SortExpression="用户名称" />
            <asp:BoundField DataField="新闻关键字" HeaderText="新闻关键字" SortExpression="新闻关键字" />
            <asp:ButtonField CommandName="del" Text="删除" />
        </Columns>
        <RowStyle BackColor="#EFF3FB" Height="25px" />
        <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" Height="30px" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:news_manageConnectionString3 %>"
        SelectCommand="SELECT * FROM [myviewnews] WHERE ([新闻关键字] = @新闻关键字2)">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlCheck" Name="新闻关键字2" PropertyName="SelectedValue"
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>

</asp:Content>


⌨️ 快捷键说明

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