How to Pass values between from a popup page aspx & a normal page aspx

  • Thread starter Marco Antonio Montalvo Durán
  • Start date
M

Marco Antonio Montalvo Durán

hi
for example, I have a page 'register.aspx' and open a second page
'popup.aspx', what I want to do is to pass the control and values obtained
in 'popup.aspx' to 'register.aspx', somebody help!!!
thanks
 
S

Steve C. Orr [MVP, MCSD]

Sounds like you'll be needing to use some client side javascript.
You can open a new window using javascript such as this:
a=window.open('MyPage.aspx','_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 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
 
M

Matt Morris

I recently had to do the same thing. You definately need to use client side
script. In my case, I used the window.open method to display the dialog,
size it and configure it. Then in my dialog, when dismissed, I implemented a
method that used the RegisterClientScriptBlock to dismiss the dialog as well
as update the page that invoked the dialog in the first place. I wired up a
method to the ServerChange event of the first page to automatically post
back the page after the dialog was dismissed. It worked out great.

Here's the dec for the method that dismisses the dialog and comminucates
with the page via client side script.

Public Sub SaveAndCloseDialog(ByVal formName as string, ByVal
controlNameToSaveTo as String, ByVal dataToSave as string, ByVal submitForm
as Boolean)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,829
Latest member
PIXThurman

Latest Threads

Top