我的代码这样写的
<head>
<title>我的页中页</title>
<script type="text/javascript" language="javascript">
function test1() {
document.getElementById("FileUpload1").click();
}
function test11() {
var filePath = document.getElementById("FileUpload1").value;
document.getElementById("TextBox1").value = filePath;
}
</script>
</head>
<body>
<form id="Form1" runat="server">
<div style="display:none">
<asp:FileUpload ID="FileUpload1" runat="server" /></div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<input id="Button3" type="button" value="选择文件" onclick="test1();"/><asp:Button ID="Button7" runat="server"
onclick="Button7_Click" Text="上传" />
</form>
</body> 后台代码是 protected void Button7_Click(object sender, EventArgs e)
{
Response.Write("<script>alert('修改成功')</script>");
}
我只是想实现文件上传的效果但是FileUpload 有些效果不太好 比如样式等
------解决方案--------------------------------------------------------
<div style="display:none">
<asp:FileUpload ID="FileUpload1" runat="server" /></div>
改成<div style="display:none">
<input type="file" id="FileUpload1" /></div>
已测试。
------解决方案--------------------------------------------------------