<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ad.aspx.cs" Inherits="admin_ad" %>

<%@ Register Src="../controls/FormPaging.ascx" TagName="FormPaging" 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>
     <link href="/admin/skin/css.css" rel="stylesheet" type="text/css" />
    <link href="/images/css/inbox.css" rel="stylesheet" type="text/css" />
    <script language=javascript>
    function UploadCheck()
    {
        if(document.getElementById("FileUpload1").value=="")
        {
            alert("请选择所上传的图片");
            return false;
        }
        else
        {
            return true;
        }
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
         <table style="width: 100%" class=Ibx_gTable_Con runat=server id="edittab">
            
            <tr>
                <td width="20%">
                    所属广告分类:</td>
                <td>
                    <asp:DropDownList ID="Drop_adclass" runat="server">
                    </asp:DropDownList>
                    <asp:HiddenField ID="adid" runat="server" />
                </td>
            </tr>
            <tr>
                <td width="20%">
                    广告文字:</td>
                <td>
                    <asp:TextBox ID="txt_letter" runat="server" Width="400px"></asp:TextBox></td>
            </tr>
            <tr>
                <td width="20%">
                    广告图片地址:</td>
                <td>
                    <asp:TextBox ID="txt_pic" runat="server" Width="200px"></asp:TextBox>
                    <asp:FileUpload ID="FileUpload1" runat="server" />
                    <asp:Button ID="btn_save" runat="server" OnClientClick="return UploadCheck()" Text="上 传" OnClick="btn_save_Click" /></td>
            </tr>
            <tr>
                <td width="20%">
                    广告JS地址(联盟广告调用):</td>
                <td>
                    <asp:TextBox ID="txt_js" runat="server" Rows="3" TextMode="MultiLine" Width="400px"></asp:TextBox></td>
            </tr>
            <tr>
                <td width="20%">
                    广告链接地址:</td>
                <td>
                    <asp:TextBox ID="txt_url" runat="server" Width="400px"></asp:TextBox></td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/admin/skin/images/button_save.gif" OnClick="ImageButton1_Click"
                        /></td>
            </tr>
        </table>
        <table style="width: 100%" class=Ibx_gTable_Con>
           <tr>
                <td colspan="2" align=center>
                    <a href="ad_add.aspx" style="color:Green">广告添加</a></td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="GridView_ad" runat="server" AutoGenerateColumns="False" CellPadding="4"
                        ForeColor="#333333" GridLines="None" Width="100%" OnRowDeleting="GridView_ad_RowDeleting" OnRowEditing="GridView_ad_RowEditing" OnSelectedIndexChanging="GridView_ad_SelectedIndexChanging" DataKeyNames="adid">
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <RowStyle BackColor="#EFF3FB" />
                        <Columns>
                            <asp:BoundField DataField="adid" HeaderText="广告ID">
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundField>
                            <asp:BoundField DataField="acname" HeaderText="所属分类" />
                            <asp:BoundField DataField="adletter" HeaderText="文字广告">
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundField>
                            <asp:CommandField HeaderText="浏览详细" ShowSelectButton="True" SelectText="浏览">
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:CommandField>
                            <asp:CommandField HeaderText="编辑" ShowEditButton="True">
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:CommandField>
                            <asp:TemplateField HeaderText="删除">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" OnClientClick="return confirm('确认删除该广告?')" runat="server" CausesValidation="False" CommandName="Delete"
                                        Text="删除"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td align="center">
                    <uc1:FormPaging ID="FormPaging1" runat="server" />
                </td>
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>
