Waqas Ali
Waqas Ali

Reputation: 1519

how to check file uploading is done on other page

I want to upload xlxs file in following way.

Clicking on Upload button i am opening new pop up window using JS function window.open('some other aspx page address here').

On other page, i have a file uploader control, a button and a label to show some status.

I want here, when user upload file and after successful completion, i want to enable button on parent page.

Can someone help me how to do this ?

Thanks in Advance.

Upvotes: 1

Views: 186

Answers (2)

Icarus
Icarus

Reputation: 63956

After successful completion of the upload, you must spit out JavaScript code to close the current popup window where the upload is happening and enable the button on the parent window. Basically, you need to write something like this, right after the file is successfully uploaded:

string code 
       = @"<script> 
              window.opener.document.getElemenById('buttonID').disabled=false;
              window.close();

         </script>";
Response.Write(code);
Response.End();

Where buttonID needs to be replaced by the actual buttonID in your parent page.

Upvotes: 1

शेखर
शेखर

Reputation: 17614

The solution could be a javascript function

window.opener.document.getelementbyid

Upvotes: 1

Related Questions