views:

27

answers:

1

I have been given a requirement to take an existing stand-alone web-form (i.e. uses postbacks) and throw it into a lightbox.

The standalone web-form already has save and cancel buttons that have predefined behaviors. For example, the Save button attempts to save the form, and either displays validation errors, or if the operation was successful, redirects to some other page in the app.

However, in the context of this new "lightbox mode", the Save button should additionally close the lightbox if the operation was successful.

I see two options:

  1. Option 1-->UpdatePanel + ModalDialogExtender:

    a. Extract a UserControl out of the standalone web-form that includes everything but save/cancel buttons

    b. Introduce Save and Cancel EventHandlers on said UserControl

    c. Use this UserControl on both the standalone and lightbox versions of the page, and wire up the events appropriately

  2. Option 2-->Client side lightbox (i.e. jQuery)

    a. ....

I'm a big fan of jQuery and tend to favor its use for Ajax functionality b/c of the level of control it gives me. On the other had, I also want the simplest solution that will possibly work. Assuming that option 2 is that option, any guidance on how to proceed would be appreciated.

A: 

I am using fancybox (see http://fancybox.net/home) with great success. It has a mode where it can show my aspx page (usually an edit form without menus and so on) in an iframe fancybox.

It can also be closed from javascript in the iframe.

Andreas Paulsson