So I have this idea of creating a asp.net user control, to handle all forms of modal popups (whether it be error handling, forms, dialogs, etc).
I already created this before, placing the user control in the top master page, exposing it to all content pages, so I could do something like:
Master.Popup.ShowException(Exception);
And the usercontrol itself would have the necessary markup to look like a modal dialog, and in the show method just do a .Visible = true.
This is all fine, but I’ve started thinking of implementing a bit of style with jquery. I’d like for the usercontrol to have some sort of jquery animation on show. But I don’t know how to go about achieving this, as I don’t know how I would call that jquery function from the codebehind instead of the popup.visible = true.
Can anyone provide me with a possible solution?
Inside your Master.Popup.ShowException(….) use something like this:
Where animateMyBox(…) is whichever animation you want to do. In the end do the popup.display=”block”; etc
Also, lookup if you can pass along a function to call back in you animate code that will execute after animating. like:
Another possibility is to use an animation that will end up in the box being visible at the end like animating opacity from 0 to 100%.
I know this is vague but you have to share more code before you can get a better answer.