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

📄 linksmanager.aspx

📁 asp.net 做的个人图书站点应用
💻 ASPX
字号:
<%@ Page Language="C#" MasterPageFile="~/Default.master" Title="Untitled Page" %>

<script runat="server">

    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        CommentManager.InsertLink(txtAddr.Text, txtContext.Text, txtClass.Text);
        GridView1.DataBind();
    }
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="Main" Runat="Server">
    <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" Height="127px"
        Width="686px" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" DataKeyNames="LinksID">
        <Columns>
           <asp:BoundField DataField="LinkAddress" HeaderText="LinkAddress" SortExpression="LinkAddress" />
            <asp:BoundField DataField="LinkContext" HeaderText="LinkContext" SortExpression="LinkContext" />
            <asp:BoundField DataField="LinkClass" HeaderText="LinkClass" SortExpression="LinkClass" />
        </Columns>
    </asp:GridView>
    <asp:Panel ID="Panel1" runat="server" Height="50px" Width="686px">
        <table frame="border" >
            <tr>
                <td style="width: 144px; height: 11px">
                    链接内容:</td>
                <td style="width: 150px; height: 11px">
                    <asp:TextBox ID="txtContext" runat="server" Width="97px"></asp:TextBox></td>
                <td style="width: 121px; height: 11px">
                    链接地址:</td>
                <td style="width: 165px; height: 11px">
                    <asp:TextBox ID="txtAddr" runat="server" Width="167px"></asp:TextBox></td>
                <td style="width: 100px; height: 11px">
                    类别:</td>
                <td style="width: 173px; height: 11px">
                    <asp:TextBox ID="txtClass" runat="server" Width="81px"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="height: 15px" colspan="6">
                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                    &nbsp; &nbsp; &nbsp; &nbsp;
                    <asp:ImageButton ID="ImageButton1" runat="server" SkinID="Add" OnClick="ImageButton1_Click" /></td>
            </tr>
        </table>
    </asp:Panel>
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:BookShow %>" SelectCommand="SELECT * FROM [Links]" DeleteCommand="Delete from Links  where LinksID=@LinksID" UpdateCommand="UPDATE Links SET LinkAddress = @LinkAddress, LinkContext = @LinkContext, LinkClass = @LinkClass WHERE (LinksID = @LinksID)">
    <DeleteParameters>
    <asp:ControlParameter ControlID="GridView1" Name="@LinksID" PropertyName="SelectedValue" />
    </DeleteParameters>
        <UpdateParameters>
            <asp:ControlParameter ControlID="GridView1" Name="LinkAddress" PropertyName="SelectedValue" />
            <asp:ControlParameter ControlID="GridView1" Name="LinkContext" PropertyName="SelectedValue" />
            <asp:ControlParameter ControlID="GridView1" Name="LinkClass" PropertyName="SelectedValue" />
            <asp:ControlParameter ControlID="GridView1" Name="LinksID" PropertyName="SelectedValue" />
        </UpdateParameters>
    
    </asp:SqlDataSource>
</asp:Content>

⌨️ 快捷键说明

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