passing server controls to child windows

  • Thread starter Thread starter Jeremy Ames
  • Start date Start date
J

Jeremy Ames

I have been trying to pass values from a parent web form to the child form.
I have been trying to Context.Handler but I keep getting an invalid type
cast when I try to cast it to the parent form class. I can receive the
parent form values on the client side, but I need to get the values before
the client page_load event. Can someone please help me?

Thanks,

Jeremy Ames
 
You're going to need to do most of this client side.
Your 2 pages simply don't exist at the same points in time on the server, so
they cannot communicate directly with eachother on the server.

You can open a new window and pass it values using client side javascript
such as this:
a=window.open('MyPage.aspx?id=123','_new')
There are all kinds of options for setting window properties such as window
size and toolbar visibility.
Here's more info:
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp

From that new window you can reference the original parent window and pass
values back to it with this javascript reference:

Here's an example:
window.opener.document.form1.mytextbox.value = 'whatever';

Here's more info:
http://www.mozilla.org/docs/dom/domref/dom_window_ref77.html
 
Back
Top