views:

138

answers:

2

Trying to put multiple dialogs on one page - they need to be able to come up more than once. I'm using ASP.NET so the ID's of the content to go in the dialogs are mangled. All of the examples for bringing up the dialog multiple times seem to work with getting the initialized dialog back the second time by using the contents ID.

I see a couple of possible solutions but they seem like hacks:
1.) Store the .net mangled ID in some other field when I first bring up the dialog, and use that the second time around.
2.) Use the dialog events to put the contents of the dialog back into its original location in the dom when the dialog is closed.

<ol>
   <li><div id="dotnetmangledjunk_Meaningful">stuff to go in the dialog</div></li>
   <li><div id="dotnetmangledjunk_Meaningful">stuff to go in the dialog</div></li>
</ol>

Similar questions here and here

+1  A: 
$("#<%=myControl.ClientID %>").dialog();
hunter
+1  A: 

I ended up using a solution similar to Hunter's except client side. I used jquery on doc ready to build a new id for the dialog content, and put that id in a place that made sense for the code that launches each dialog. This had the added benefit of initializing the dialogs once - allowing the dialog to move the content to a new place in the dom, and calling it by ID.

Zac
note that you can accept your own answer @Zac
Earlz