FileUp.aspx 页面
1
<%
@ Page language="c#" Codebehind="FileUp.aspx.cs" AutoEventWireup="false" Inherits="TestCenter.FileUp" %>
2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
3
<HTML>
4
<HEAD>
5
<title>多文件上传</title>
6
<script language="JavaScript">
7
function addFile()
8
{
9
var str = '<INPUT type="file" size="50" NAME="File">'
10
document.getElementById('MyFile').insertAdjacentHTML("beforeEnd",str)
11
}
12
</script>
13
</HEAD>
14
<body>
15
<form id="form1" method="post" runat="server" enctype="multipart/form-data">
16
<div align="center">
17
<h3>多文件上传</h3>
18
<P id="MyFile"><INPUT type="file" size="50" NAME="File"></P>
19
<P>
20
<input type="button" value="增加(Add)" onclick="addFile()">
21
<input onclick="this.form.reset()" type="button" value="重置(ReSet)">
22
<asp:Button Runat="server" Text="开始上传" ID="UploadButton"></asp:Button>
23
</P>
24
<P>
25
<asp:Label id="strStatus" runat="server" Font-Names="宋体" Font-Bold="True" Font-Size="9pt"
26
Width="500px" BorderStyle="None" BorderColor="White"></asp:Label>
27
</P>
28
</div>
29
</form>
30
</body>
31
</HTML>
32

<%
@ Page language="c#" Codebehind="FileUp.aspx.cs" AutoEventWireup="false" Inherits="TestCenter.FileUp" %> 2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 3
<HTML> 4
<HEAD> 5
<title>多文件上传</title> 6

<script language="JavaScript">
7
function addFile() 8

{ 9
var str = '<INPUT type="file" size="50" NAME="File">' 10
document.getElementById('MyFile').insertAdjacentHTML("beforeEnd",str) 11
} 12
</script> 13
</HEAD> 14
<body> 15
<form id="form1" method="post" runat="server" enctype="multipart/form-data"> 16
<div align="center"> 17
<h3>多文件上传</h3> 18
<P id="MyFile"><INPUT type="file" size="50" NAME="File"></P> 19
<P> 20
<input type="button" value="增加(Add)" onclick="addFile()"> 21
<input onclick="this.form.reset()" type="button" value="重置(ReSet)"> 22
<asp:Button Runat="server" Text="开始上传" ID="UploadButton"></asp:Button> 23
</P> 24
<P> 25
<asp:Label id="strStatus" runat="server" Font-Names="宋体" Font-Bold="True" Font-Size="9pt" 26
Width="500px" BorderStyle="None" BorderColor="White"></asp:Label> 27
</P> 28
</div> 29
</form> 30
</body> 31
</HTML> 32
