In order to recreate the UI experience found in an existing Access forms Db I was porting to ASP.NET, I really wanted to use popup forms when the user clicked on a list of available items.
Each item was unique and I would dynamically load an user control into a placeholder on teh child form based on what item criteria was passed to it (in a query string). On the parent form, the list of items would toggle between either "Edit" Or "Add" depending on whether the container object for the items already had that item in it or not persisted to the Db.
So I built a nifty server control that would popup my new window and send the encrypted query string ot the child page. The child would parse the querystring and then dynamically load the appropriate ascx in my manager class. Poof! Worked great!
So now the hard part. I wanted to be able to save the data in the child form and then update the parent form;s toggled "Edit/Add" button text, indicating a new item had been persisted. Simply causing a postback on the child form's unload event wouldn't work because the parent form would actually post BEFORE the child form and then bind its controls prior to my child page's save event. I needed to be able to process the data fetched from the child page FIRST on the server and THEN cause the update inthe parent form. What to do? I implemented a bool variable "postbackParent" which would be set to "true" when my child page's Save event occured. Then, I hooked into the page's PreRender event from the ascx and checked if postbackParent was true. If it is, I emit a bit of javascript onto the child page's "load" event that fires the postback on the parent page. WAHLAH! The page updates with the binding using the new data from teh child form.