0

I am using ajax modal pop in my asp.net + C# application. My application must show this modal in two situations.

  1. When every thing is ok and the file is read and the data is imported to the database.

  2. When the server side code checks the values that need to be inserted to the database and if they are not correctly formatted, it shows a warning message and a button, so the user would have the option to still insert the erroneous data of the file to the database.

I am using this modal to stop the user from interacting with the controls while the import is being done and it works fine. But for the second scenario I see the modal and when the message and button appear on the screen the modal is still covering the page so the user cannot click on the button or do anything basically. How can I solve this problem?

I thought maybe making the message and button appear on the modal would be an option, but I don't know how to that either. Any suggestions?

/Mono

MONO
  • 13
  • 4

2 Answers2

0

Heres a tutorial to help you get started wiht the modal itself. http://yensdesign.com/2008/09/how-to-create-a-stunning-and-smooth-popup-using-jquery/

This is actually a more difficult task then it first appears. Your probably going to want to use ajax, and contact a webmethod to see if there is any errors. Probably make times calls checking for complete, or errors.

File uploads want to do a post back, getting them to do this async is tricky. You may want to research async uploads(or a flash uploader) and see if there are any free uploaders out there. The regular html file uploader control is not asycn.

What you could do is let the page post back, then have javascript run on the page reload, and if it is complete or errors, show the popup.

-Show the modal overlay, while it uploads. -postback, then run script after postback and on the client page reload show modal success or failed.

Yogurt The Wise
  • 4,379
  • 4
  • 34
  • 42
  • Hm, I'm wondering how I could do what you said? Can you give me a simple sample code? – MONO Aug 19 '11 at 14:09
  • Heres some more info on the subject. Sorry, no code i can provide, its all at my last job. http://stackoverflow.com/questions/166221/how-can-i-upload-files-asynchronously-with-jquery – Yogurt The Wise Aug 19 '11 at 14:33
0

I suggest you to change to 3 modal dialogs

  1. Uploading..
  2. Everything went ok
  3. Please fix the following data below:

You will always start with 1. And then replace it with number 2 or 3, according with what happened at the upload.

If the file upload usually takes usually more than 30 seconds, you may want to consider using a flash upload to provide some feedback to the user at Uploading screen.

Germán Rodríguez
  • 4,284
  • 1
  • 19
  • 19