0 Replies - 699 Views - Last Post: 19 August 2008 - 08:55 AM

#1 ysba  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 19-August 08

Getting information back from a child window to its parent

Posted 19 August 2008 - 08:55 AM

Hi,

I have seen multiple ways to pass information from a pop-up window to its parent.
Even though I have tried many variation I am still stuck.

I have a variable on the pop-up window lblText (label, where I am saving the information I want to get back to the parent window).

Then on the parent window I have a txtNote (text box) where I want to see the results from my selection on pop-up window.

So far I have the following code on my pop-up window:
	Protected Sub btnSelect_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSelect.Click
		Try
			ClientScript.RegisterStartupScript(Me.GetType, "Javascript1", "<script>window.opener.document.getElementById('txtNote').value = document.lblText.value %>;</script>")
			ClientScript.RegisterStartupScript(Me.GetType, "Javascript2", "<script>window.close();</script>")
		Catch ex As Exception
			lblErrorMsg.Text = ex.Message
			lblErrorMsg.Visible = True
		End Try
	End Sub



So, my guess is that I am not referring to the elements (lblText and txtNote) on the respective pages correctly. But I have tried multiple variations and I have not been able to pass the information.
Could someone please give me a hand with this?
Thanks in advance,
ysba

Is This A Good Question/Topic? 0
  • +

Page 1 of 1