Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is this possible - Child Pages 2

Status
Not open for further replies.

Fubear

IS-IT--Management
Sep 11, 2002
299
GB
I am converting an HTML site template to ASP.Net.

One of hte pages will have a dropdown list of records, the user selects a record and either clicks on either Edit or New. When this happesm some Javascript fires off and opens a new window with the details.

Is it possible in ASP.NET to have the selectBox of records update with the update/addition when the close button is clicked on the poopup page?

This is my first ever ASP.net project, so im a little unsure of a lot of things at the moment.
 
I would think that this would be done with some code similar to:

System.Web.UI.Page ChildPage = New System.Web.UI.Page()
or
MyASPPageName = new MyASPPageName()

This should allow me to open the child window, and control its public properties and methods, although for the child to manipulate the parent i would need to have to override the contructor to pass in the parent page.

MyASPPageName = new ASPPageName(this)

I dont know how 'safe' I would be overriding the constructor, as the original constructors code would not run? Not sure on this one.

Finally, i dont know if I could somehow pickup on the Unload() event of the child window from the parent window, is this possible somehow?
 
could you update the application via a submit on the popup page and then return a script block which passes a submit command (or directly updates the dropdown) to the opening window and closes the popup using clientside Javascript?

The "parent" page would then pick up the changes on the server and return the webform to the browser with the updated drodpdown. I maybe way off track with what you want to do here but the approach your are suggesting seems overly complex.

Also remember the .NET framework destroys all knowledge of the webform as soon as the Response is sent to the client so I don't think you could have a parent/child relationship on the server anyway - this would have to be done clientside using window.opener in Javascript.

Hope this helps

Rob

------------------------------------

On with the dance! let joy be unconfined;
No sleep till morn, when Youth and Pleasure meet
To chase the glowing hours with flying feet.
-Byron

------------------------------------
 
Thats similar to what I have at the moment.

If i call a form.submit from the javascript - I would assume that it would be sent back to the server using postback, simply reloading the data from the server.

I will give it a try and let you all know how I get on.
 
OR, you could create panels on the web form that hold all the controls that the new pages would have, and then just hide/unhide them as needed. That way, updating the drop lists would be a piece of cake (black forest at that)

D'Arcy
 
jfrost10 - thats the best idea yet.

Is there any way I could have a panel float over the text, hiding (and disabling) the form behind until the panel is closed?

 
The easiest way to do that would be to put all the controls from your page into a panel as well, and then just hide the panel when you want one of the child-panels to show.

D
 
Thanks a lot - I have one page with one section that changes depending on what the user is trying to do. No need for popup windows any more :eek:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top