当我启动页面时,它给了我这个错误。我可以按否,但代码不起作用。
代码是我如何解决这个错误?顺便说一下,按钮浏览会打开文件上传,但这是在 c# 中提前谢谢。
<%@ control language="C#" autoeventwireup="true" inherits="Web_Controls_SOLATDFileChooser, App_Web_ivmyhbca" %>
<!--2012-05-11 TP : Redesign da página web -->
<link rel="stylesheet" type="text/css" href="../styles/CMM/InternetFace.css" />
<style type="text/css">
div.fileinputs
{
position: relative;
}
div.fakefile
{
position: absolute;
top: 0px;
left: 0px;
z-index: 1;
}
input.file
{
visibility: hidden;
}
</style>
<script type="text/javascript" language="javascript">
function clear() {
document.getElementById("<%=FileUpload1.ClientID %>").value = "";
document.getElementById("<%=txtFileName.ClientID %>").value = "";
}
</script>
<script type="text/javascript" language="javascript">
function uploadFileChange() {
document.getElementById("<%=txtFileName.ClientID %>").value = document.getElementById("<%=FileUpload1.ClientID %>").value;
}
</script>
<table width="500px">
<tr>
<td valign="middle">
<div class="fileinputs">
<!-- Upload file invisivel-->
<asp:FileUpload ID="FileUpload1" class="file" runat="server"
onchange="uploadFileChange();" />
<!-- button e textbox falsas para poder dar syles-->
<div class="fakefile">
<!--textbox onde está o path do ficheiro-->
<asp:TextBox ID="txtFileName" CssClass="textbox" runat="server"
Width="300px" ReadOnly="true" />
<!-- button de browse-->
<asp:Button ID="btnBrowse" runat="server" Text="Procurar..."
ForeColor="White" Height="21px" />
<!--button para apagar o path ja que a textbox esta em read-only para prevenir erros-->
<asp:Button ID="btnCancel" Height="21px" CssClass="btnSubmit" Text="Apagar" ForeColor="White"
OnClientClick="clear();" runat="server" />
</div>
</div>
</td>
</tr>
</table>