-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Arun Raj.C
Message 1 in Discussion
I regularly find
this question on many forums with long discussions about it, and I have found
the following code with Javascript to be the best and easiest way to open a
popup page, send a value, refresh the parent page, and close the popup child
page. The following is an example of one way to refresh the parent
page from a child popup. First off, you can add the following code
on a button of the parent page to send the ID value as a cookie to
the popup child page.
Response.Cookies ("ID").Value = TextBox1.TextDim sScript As StringsScript =
"<script>window.open ('SurveyResults.aspx','','height=300, width=300,
scrollbars=no') ;< /script>"Response.Write (sScript)
This will open up SurveyResults.aspx page as a popup child page.
Then add the following code on the Page.Load event of SurveyResults.aspx
page (the popup child page).
Private Sub Page_Load(ByVal sender As System. Object, ByVal e As
System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page
here If Not Page.IsPostBack Then Dim IDGet As Integer IDGet =
Request.Cookies("ID").Value //with this IDGet, run the command and fill ds
or whatever and then// Dim cScript As String cScript = "<script
language='javascript'> opener.location.href = 'Survey.aspx'; </script>"
RegisterStartupScript("parentwindow", cScript) End IfEnd Sub
To close the popup child page, you
can have a button on SurveyResults.aspx page to add the following code.
Private Sub btClose_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btClose.Click
Response.Write("<script>window.close();</script>")End Sub
That is all there is to it. I
hope you will find this helpful.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]