<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LinkAdmin.aspx.cs" Inherits="Oykx.admin.LinkAdmin" %>

<!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>友情链接 -
        <%=Resources.zhouxiang.adminTitle %></title>
        <link href="css/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td class="td_title">
                    友情链接
                </td>
            </tr>
            <tr>
                <td class="tableTd">
                    <asp:GridView ID="GridView_Link" runat="server" AllowPaging="True" 
                        AutoGenerateColumns="False" DataKeyNames="LID" DataSourceID="Object_Link" 
                        SkinID="LID"  Width="100%" onrowcommand="GridView_Link_RowCommand" 
                        onrowdatabound="GridView_Link_RowDataBound">
                        <Columns>
                            <asp:TemplateField HeaderText="标识ID" SortExpression="LID">
                                <EditItemTemplate>
                                    <asp:Label ID="Labeled" runat="server" Text='<%# Bind("LID") %>'></asp:Label>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("LID") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="LName" HeaderText="链接名称" SortExpression="LName" />
                            <asp:BoundField DataField="Lurl" HeaderText="链接地址" SortExpression="Lurl" />
                            <asp:BoundField DataField="LDesc" HeaderText="链接备注" SortExpression="LDesc" />
                            <asp:CommandField ShowEditButton="True" ButtonType="Image" 
                                CancelImageUrl="~/admin/image/quxiao.png" EditImageUrl="~/admin/image/edit.png" 
                                HeaderText="编辑" UpdateImageUrl="~/admin/image/queding.png" />
                            <asp:TemplateField HeaderText="删除" ShowHeader="False">
                                <ItemTemplate>
                                    <asp:ImageButton ID="ImageBtnDel" runat="server" CommandName="del"  CausesValidation="false" 
                                        CommandArgument='<%# Bind("LID") %>' ImageUrl="~/admin/image/del.png" Text="删除" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
            </table>
    </div>
    <table width="100%">
     <tr>
                <td class="td_title">
                    添加链接</td>
            </tr>
            <tr>
                <td class="tableTd">
                    链接名称:<asp:TextBox ID="txtname" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="txtname" ErrorMessage="*"></asp:RequiredFieldValidator>
&nbsp; 链接URL:<asp:TextBox ID="txturl" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ControlToValidate="txturl" ErrorMessage="*"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="tableTd">
                    链接备注:<asp:TextBox ID="txtdesc" runat="server" Width="310px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="tableTd">
                    <asp:Button ID="btnadd" runat="server" onclick="btnadd_Click" Text="提交" />
&nbsp;</td>
            </tr>
       
            </table>
    <div style=" height:5px;">&nbsp;</div>
     <table width="100%">
     <tr>
                <td class="td_title">
                    友情提示</td>
            </tr>
            <tr>
                <td class="tableTd">
                    1.设置友情链接,可以让你的网站和其余网络形成一个连接接口.</td>
            </tr>
            <tr>
                <td class="tableTd">
                    2.和别人交换友情链接时,请设置日IP访问较大的网站.</td>
            </tr>
            <tr>
                <td class="tableTd">
                    3.友情链接,也可以用来广告等.</td>
            </tr>
       
            </table>
    <asp:ObjectDataSource ID="Object_Link" runat="server" 
        DataObjectTypeName="OykxModel.Links" DeleteMethod="delete" InsertMethod="add" 
        SelectMethod="get" TypeName="OykxBLL.LinkManager" UpdateMethod="Update">
        <DeleteParameters>
            <asp:Parameter Name="LID" Type="Int32" />
        </DeleteParameters>
    </asp:ObjectDataSource>
    </form>
</body>
</html>