<%@ page language="C#" autoeventwireup="true" inherits="Programmer_CodeUp, App_Web_wasovt3g" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>

<!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 id="Head1" runat="server">
    <title>新增项目</title>
    <link href="../CSS/All.css" rel="stylesheet" type="text/css" />
    <style>
        .division th {
        background:none repeat scroll 0 0 #E2E8EB;
        border-right:1px solid #CCCCCC;
        font-size:10pt;
        text-align:right;
        font-weight:500;
        width:140px;

        }
        .division {
            background:none repeat scroll 0 0 #FFFFFF;
            border-color:#CCCCCC #BEC6CE #BEC6CE #CCCCCC;
            border-style:solid;
            border-width:1px 2px 2px 1px;
            line-height:150%;
            padding:5px;
            white-space:normal;
            margin:5;
       }
       .division td, .division th{
            border-color:#FFFFFF #DBE2E7 #DDDDDD #FFFFFF;
            border-left:1px solid #FFFFFF;
            border-right:1px solid #DBE2E7;
            border-style:solid;
            border-width:1px;

       }
       h5{
        margin:0;
        padding:5px;
        background-color:#E2E8EB;
        font-size:11pt;
       }
       .division .font1{
        font-weight: bold;
        color: #696969
       }
     
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div >
        <h5>
            代码上传</h5>
            <div class="division">
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <th>
                            代码上传：</th>
                        <td>
                            <asp:FileUpload ID="FileUpload" runat="server" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="FileUpload"
                                ErrorMessage="选择上传文件" ValidationGroup="insert"></asp:RequiredFieldValidator></td>
                    </tr>
                    <tr>
                        <th style="height: 83px">
                            上传备注：</th>
                        <td style="height: 83px">
                            <asp:TextBox ID="txtBeizhu" runat="server" Height="74px" TextMode="MultiLine" Width="336px"></asp:TextBox></td>
                    </tr>
                </table>
            </div>
        <div align="center" style="width: 100%; background-color: lightgrey">
            &nbsp;
            <asp:Button ID="btnSubmit" runat="server" CssClass="btn" OnClick="btnSubmit_Click"
                Text="保存并返回" Width="115px"  OnClientClick="return UpCheck()" />
            <asp:Button ID="btnback" runat="server" CssClass="btn" OnClick="btnback_Click" Text="返回"
                Width="115px" /></div>
            
            
        </div>


    </form>
    
 <script>
   function trim(str){ //删除左右两端的空格
　　    return str.replace(/(^\s*)|(\s*$)/g, "");
   }
   function UpCheck(){
        var imgFile =  document.getElementById("<%=FileUpload.ClientID %>");
        if(trim(imgFile.value)=="")
        {
            alert("请选择上传的代码！");
            return false;
        }
        if (!imgFile.value.match(/.zip|.rar|.ZIP|.RAR/i)) {
             alert(' 请上传.zip|.rar|.ZIP|.RAR类型的打包文件');
             return false;
        }
        return true;
    }
    
 </script>

</body>
</html>
