views:

31

answers:

1

I am using an ASP.Net MVC site that has a link to an ASP.Net WebForms page that performs the actual download. I would like my jquery ui dialog to close when the download starts. Is there a javascript/jquery event that I can use to accomplish this?

I found an example with exactly what I want to do here, but since I'm using MVC instead of WebForms I can't seem to get it to work.

A: 

Two possibilities:

  1. Target your form at a hidden <iframe>, and close your dialog from a "load" handler on the window object in the <iframe>
  2. Have the client create a random string and post it with the form, and then start a polling loop to check document.cookie to see if it contains the random string. The server should set a cookie whose value is that random string, and it should do that in the header for the file being sent out. When the client polling loop sees the cookie, it can close the dialog.
Pointy
Thanks, using a hidden <iframe> helped out a lot.
vanillaike