-2

I create a dialog with in .aspx. This dialog is to update something and show the progress and I want it close automatically when the update is done. So can I close the dialog from the c# code without clicking the "Ok" or "Cancel" button when something is done?

I opened this dialog using a self-made dialog class of my company. I put a "neatUpload" element into this dialog so it can upload some file from the client machine to the server. What I want to achieve is close the dialog when the uploading is done. I don't know whether it is possible or not.

Thank you

bgmCoder
  • 6,205
  • 8
  • 58
  • 105
  • Please provide more information and maybe a html markup for your dialog and how you open it. – fenix2222 Jul 05 '12 at 23:24
  • Asp-classic? You can't really close client side dialog with server side code... please clarify what you want to achieve and if any client side code is running (i.e. AJAX queries server and shows dialog) – Alexei Levenkov Jul 05 '12 at 23:28

2 Answers2

0

It depends on the kind of dialog you're using, if it's a window.alert, it cannot be closed other than by clicking on the 'OK' button. You will need a JQuery dialog or such to achieve your goal.

Julien Ch.
  • 1,231
  • 9
  • 16
  • I am not using an window alert. It is a kind of dialog class defined by my company. It is similar to using DialogEl I think. Thank you – Gavin Wang Jul 05 '12 at 23:28
  • There seem to be 2 javascript event handlers on your flash uploader fileComplete and queueComplete, they should allow you to close your dialog from the client side when you file(s) is/are uploaded. – Julien Ch. Jul 06 '12 at 06:10
0

You can't shutdown a client-side script from a server-side. It's not a desktop app, web apps work differently.

EDIT:

Maybe there's a way, based on your edit... I suppose you could use ajax to notify the client after the job is done and then use javascript in the dialog to close itself.

walther
  • 13,466
  • 5
  • 41
  • 67