<%@ Page Title="" Language="C#" MasterPageFile="~/Manage/Master/AdminMP.Master" AutoEventWireup="true" CodeBehind="BannerEdit.aspx.cs" Inherits="MyCms.Manage.Banners.BannerEdit" %>
<%@ MasterType VirtualPath="~/Manage/Master/AdminMP.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <table cellpadding="5" cellspacing="5">
        <tr>
            <td>轮播图名称：</td>
            <td>
            <asp:TextBox ID="tbBannerName" runat="server"></asp:TextBox></td>
            <td></td>
        </tr>
        <tr>
            <td>轮播图片：</td>
            <td>
                <input type="button" id="uploadbtn" value="上传图片" /><span id="uploadstatus">646x248</span>
                <style>
        #imgcontainer img {max-width:680px;margin-top:10px;}
    </style>
                <div id="imgcontainer">
                    <%=imgHtml %>
                </div>
                <input type="hidden" id="imgurl" name="imgurl" value="<%=imgurl %>" />
            </td>
            <td></td>
        </tr>
        <tr>
            <td>链接地址：</td>
            <td><asp:TextBox ID="tbUrl" runat="server"></asp:TextBox></td>
            <td></td>
        </tr>
        <tr>
            <td>打开方式：</td>
            <td><asp:TextBox ID="tbTarget" runat="server"></asp:TextBox></td>
            <td></td>
        </tr>
        <tr>
            <td>排序：</td>
            <td><asp:TextBox ID="tbSort" runat="server"></asp:TextBox></td>
            <td></td>
        </tr>
        <tr>
            <td></td>
            <td><asp:Button ID="btnSave" runat="server" Text="保存" OnClick="btnSave_Click" /></td>
            <td></td>
        </tr>
        </table>
    <script type="text/javascript" src="<%=ResolveUrl("~/Static/Script/ajaxupload.js") %>"></script>
    <script type="text/javascript" src="<%=ResolveUrl("~/Static/Script/Comm.js") %>"></script>
    <script>
        var action ='<%=ResolveUrl("~/Handler/Upload.ashx")%>';
        upload('uploadbtn', 'uploadstatus', 'image', action, callback)
        function callback(file, response) {
            if (response.status) {
                $('#uploadstatus').html('上传成功！');
                $('#imgurl').val(response.imgurl);
                $('#imgcontainer').html('<img src="' + response.imgurl + '" />');

            }
        }
    </script>
</asp:Content>
