Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

upload a file then close the form

Status
Not open for further replies.

SpeedBWild

Programmer
Apr 29, 2004
117
US
Once I upload a file. I would like to close the window and return a value back to the parent window. Using retval=window.showModalDialog I can open the upload window. My form tag for the upload window is
<form id="form1" enctype="multipart/form-data" runat="server" method="post">. Once the upload is complete I want to return a value to the parent and close the upload winodw. I am calling this javascript function for that
function ClosePopUp(retVal){
window.returnValue=retVal;
window.close();
}
Window.close does not seem to be working. I think it is because of the enctype="multipart/form-data". Can anyone verify that? Does anyone know of a way around this?

Any help would be appreciated.

Thanks,
 
>>enctype="multipart/form-data"

means that the form is going to upload files, thats it. it does not affect the way ur JS works. it could be a JS error. try debugging it by opening a normal popup...

Known is handfull, Unknown is worldfull
 
In the "code behind" page...
After you finished uploading the file do this...

Page.RegisterStartupScript("window.returnValue=" & sValue & "; window.close();")

sValue can be whatever value you want to return (no spaces).
You will need to remove the function from the aspx page.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top