I'm making an application in which I need to send an asp button by means of JavaScript after uploading a file in a FileUpload, I use the document.getElementById('nameButton').click();
sentence in Chrome, Firefox works correctly but in IE8 crashea and throws me the following message:
and this is my code:
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript">
function precargar() {
document.getElementById('<%=btnCargaImg.ClientID%>').click();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div> <asp:Label ID="lblMsj" runat="server" Text="..."></asp:Label><br /><br />
<asp:FileUpload ID="fileUp" runat="server" onchange="precargar();"
OnPreRender="fileUp_PreRender"></asp:FileUpload><br /><br />
<br /><br />
</div>
<asp:Button ID="btnCargarImg" runat="server" Text="Cargar Imagen" OnClick="btnCargarImg_Click" />
</form>
</body>