Sunday, March 11, 2012

ModalPopup and Postbacks -or- ModalDialogs?

Is something like this what you are after?

http://www.4guysfromrolla.com/demos/DontSubmitTwice2.htm

Although, you could put more data on the div other than a message...

amar


amarsuperstar:

Is something like this what you are after?

http://www.4guysfromrolla.com/demos/DontSubmitTwice2.htm

Well, this kinda goes back to my comment about not writing tons of cross-browser compatible javascript with transparent divs in order to accomplish this task. But, I have seen this and this is the basic principle of what I'm trying to do. Problem is with this page, it's lacking in quality, opacity issues in Opera, etc. So, while this is the very basics of it, I have seen other scripts and code that do this pretty well, but they are also chock full of javascript for cross-platform support and variouis other things.

I just want something simple like the ModalPopup that just works with little to do than just putting it on the page.

Using the bit of code I have above, I can get it to work... sorta. It will post while the ModalPopup is being displayed. The problem is that the clientside .Net validations don't get fired until after the ModalPopup is displayed (obviously) and then I have no way of hiding the popup once those validations have fired. So, what I see is the ModalPopup and then a validation error underneath it with no way of getting to it.

Do appreciate the suggestion though. Thanks.

Gunner


Well, I think I've solved my problems. I've got it working now almost perfectly. The only last issue I have is trivial at best. I was able to see validations get fired and stop the popup from coming up if any validations failed. I was even able to attach this to every button on any given page regardless of whether or not the button had the CausesValidation set to true or false. The trivial issue I have left is that I can't seem to keep the animated GIF I have in the popup to animating. I had it animating at one point and then it stopped. Again, trivial, but worth a mention I guess.

Cheers...

No comments:

Post a Comment