views:

229

answers:

4

I wonder if anyone can think of a good technique to enable any arbitrary section of an aspx page (say, the contents within a specified DIV tag) to be able to be called and displayed in an ajax modal popup? (So, only a certain section of the page would be displayed)

For example:
1) You have a large application with many entities (Customers, Products, Stores, etc, etc etc)
2) Each entity has an EntityDetails aspx page

Now, say from an Invoice screen that shows many entities of different types, I would like to be able to mouseover (or click a small icon) an entity, and have a little tooltip style modal ajax window popup, and what is shown will be the PORTION of the corresponding EntityDetails aspx page that was designated as available for rendering as a popup. Obviously, the corresponding aspx arguments identifying the specific entity would have to be passed from the page as well.

So to do this, ** I think the requested page would have to be rendered in memory on the server **, and then the innerhtml would have to be pulled out of the designated div, and returned to the calling page, which would then display this html in a popup ajax window. So, unless there is an easier way to do this that I am missing, how would this rendering be done on the server?

Has anyone seen this done before, is there any sort of a pre-existing framework or anything to do this?

And to complicate things further, would it be possible to have the popup form be editable and saved back to the server utilizing the existing asp.net form mechanism already embedded within the existing page (if the calling form already had an asp.net form....I think only one form is allowed per page, correct?)

And of course, opening the EntityDetails form via a simple javascript popup or new window is not what I am looking for. And I do not want to have to embed the details form on each page where I may want it to display...every form in the application could conceivably call any other as a popup.

Thanks!

+1  A: 

You could most likely do this with a collection of user controls and the ModalPopupExtender that is available in the AJAX Control Toolkit.

Mitchel Sellers
+1  A: 

If you're using user controls for the edits, I think you could do it with Greybox. Pass the user control name (and other parameters) to the page you show in greybox, then dynamically load the user control that does the edit.

Danimal
This looks interesting indeed...however, the examples on ths ite don't seem to work on my machine here at work....the popup displays but never finished loading the webpage (even the load google in a popup example). Are there firewall issues perhaps?
tbone
Update: This page doesn't work: http://www.orangoo.com/labs/GreyBox/This page does: http://orangoo.com/labs/greybox/advance_usage.html So it is an interesting solution. The part it doesn't handle though is just showing a specific section of the page.
tbone
A: 

I can't vote but user controls would be the way to.

Luke
A: 

http://api.jquery.com/load/ http://css.dzone.com/articles/jquery-load-data-from-other-pa

tbone