weblink.aspx

来自「计算机实验课在线答疑系统 09年毕业设计」· ASPX 代码 · 共 74 行

ASPX
74
字号
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="weblink.aspx.cs" Inherits="weblink" %>

<%@ Register Src="WebUserControl.ascx" TagName="WebUserControl" TagPrefix="uc1" %>

<!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">
    <title>无标题页</title>
</head>
<body bgcolor="LightGrey">
    <form id="form1" runat="server">
    <div align=center >
        <uc1:WebUserControl ID="WebUserControl1" runat="server" />
        &nbsp;<br />
        <br />
        &nbsp;<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT [id], [class] FROM [class]"></asp:SqlDataSource>
        <asp:Label ID="Label1" runat="server" Height="22px" Text="请选择网站类别:" Width="124px"></asp:Label>
        <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource3" DataTextField="class" DataValueField="id" AutoPostBack="false" CausesValidation="True" >
            <asp:ListItem Selected="True">df</asp:ListItem>
            <asp:ListItem>df</asp:ListItem>
        </asp:DropDownList>
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="显示" />&nbsp;
        <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="显示全部" /><br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="id"
            DataSourceID="SqlDataSource2" Height="274px" Width="732px" AllowPaging="True" AllowSorting="True" CaptionAlign="Left" CellPadding="0" ForeColor="#333333" GridLines="None">
            <Columns>
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
                    SortExpression="id" />
                <asp:BoundField DataField="name" HeaderText="网站名字" SortExpression="name" />
                <asp:HyperLinkField DataNavigateUrlFields="link" DataTextField="link" HeaderText="网站地址" />
                <asp:BoundField DataField="show" HeaderText="网站简介" SortExpression="show" />
                <asp:BoundField DataField="cid" HeaderText="cid" SortExpression="cid" Visible="False" />
                <asp:BoundField DataField="link" HeaderText="网站地址" SortExpression="link" Visible="False" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <EditRowStyle BackColor="#999999" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
         SelectCommand = "SELECT [id], [name], [link], [show], [cid] FROM [linki] ORDER BY [id] DESC" DeleteCommand="DELETE FROM [linki] WHERE [id] = @id" InsertCommand="INSERT INTO [linki] ([name], [link], [show], [cid]) VALUES (@name, @link, @show, @cid)" UpdateCommand="UPDATE [linki] SET [name] = @name, [link] = @link, [show] = @show, [cid] = @cid WHERE [id] = @id" >
            <SelectParameters>
                <asp:ControlParameter ControlID="DropDownList2" Name="cid" PropertyName="SelectedValue"
                    Type="Int32" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="name" Type="String" />
                <asp:Parameter Name="link" Type="String" />
                <asp:Parameter Name="show" Type="String" />
                <asp:Parameter Name="cid" Type="Int32" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="name" Type="String" />
                <asp:Parameter Name="link" Type="String" />
                <asp:Parameter Name="show" Type="String" />
                <asp:Parameter Name="cid" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
        <br />
        <br />
        </div>
    </form>
</body>
</html>
         

⌨️ 快捷键说明

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