<%@ Page Title="" Language="C#" MasterPageFile="~/Dialog/DialogMaster.Master" AutoEventWireup="true"
    CodeBehind="SysTemplatePicList.aspx.cs" Inherits="OAWeb.Sys.SysTemplatePicList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="width: 700px; height: 470px; padding: 10px">
        <table class="data_title" cellspacing="3">
            <tr>
                <td class="data_field">
                    <input name="file_uploader" type="file" />
                    <input id="btnUpload" type="button" value=" 上 传 " class="btn_77px" />&nbsp; <span
                        class="tip01">多个图片可以打包为RAR后在上传,同名图片会覆盖</span>
                </td>
            </tr>
        </table>
        <div class="list" style="height: 400px; overflow-y:scroll;">
            <asp:GridView ID="gvData" runat="server" AutoGenerateColumns="False" GridLines="None"
                CellPadding="0" CssClass="table_list" EnableModelValidation="True" OnRowDataBound="gvData_RowDataBound">
                <RowStyle HorizontalAlign="Left" />
                <Columns>
                    <asp:TemplateField HeaderText="图片">
                        <ItemTemplate>
                            <img src='<%#Eval("PicPath") %>' width="50px" height="50px" />
                        </ItemTemplate>
                        <ItemStyle Width="100px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="PicPath" HeaderText="路径" />
                    <asp:TemplateField HeaderText="操作">
                        <ItemTemplate>
                            <asp:LinkButton  ID="lbtnDelete" runat="server">删除</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btnUpload").click(function () {
                var btn = $(this);
                btn.attr("disabled", "true");
                $("#aspnetForm").ajaxSubmit({
                    url: "SysTemplatePicList.aspx?op=UploadFile&t=<%=TempType %>&r=" + Math.random(),
                    success: function (result) {
                        if (result.indexOf("ok") > -1) {
                            alert("上传成功");
                            window.location.href = window.location.href;
                        } else {
                            alert(result);
                        }
                        btn.removeAttr("disabled");
                    }
                });
                return false;
            })
        });
    </script>
</asp:Content>
