asp.net - [Need help]: Issue with submit button and html file input control’s Click() method -


scenario: on click of button, dynamically create html file input (file upload) control on page , call file input controls click() method. user selects file disk. there “submit” button upload selected file.

problem: problem is, when clicked on “submit” button first time, input value file input control cleared. , request not go server. when clicked second time, request goes server empty file input value.

why first click on submit button not send request server. , why clears file input control value?

note: issue observed when call click() method programmatically. if let user click browse, in case, "submit" not clear input value , sends request server on first click itself.

any appreciated. in advance.

by way, server side code in asp.net , client side in java script, testing on ie.

-somesh

can inject javascript code-behind call client-side click() event on file upload control? simulate user clicking submit button, know works.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -