Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In my ASP.NET code I use that script :
<script type="text/javascript">
	function fireFileClick() {
		debugger;
		var objfile = Object;
		objfile = document.getElementById("<%= UpLoadButton.ClientID %>");
		objfile.click();
				}
</script>


The script is working just fine on Internet Explorer, but when I'm tying to use any other explorer is not working.
That means the "selected File" not passed to the `FileUpload` control.
Under the Chrome browser (with F12) I open the `debugger` and what I see there surprises me allot.
Which means; when the `debugger` is `on` then the file uploads on the control and the all processes goes fine.
But when the `debugger` is off then the selected file it is not uploaded to the control.
Is someone to solve that mystery?

I forgot to mention that I have two controls in ASP.NET
<asp:Button ID="UpLoadFile" runat="server" Value="Add" Text="Επιλογή αρχείου" onclientclick="fireFileClick()" onclick="ControlHasFile" CssClass="FileSelection"   />
<asp:FileUpload ID="UpLoadButton" runat="server"  />
control.

What I have tried:

Nothing more that what I mention before.
Posted
Updated 21-Jan-19 1:53am
v5
Comments
F-ES Sitecore 21-Jan-19 5:30am    
How is fireFileClick called? I'm guessing you probably have a form submission happening somewhere.
Lefteris Gkinis 21-Jan-19 5:32am    
I have improve my question And I think that is unswerving to you. But in any case ask me more

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900