473,382 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How to remains data inserted in parent page after open the child page

i have a problem to display the data inserted at parent page.After i click a button submit at child page,the data that was inserted before are lost...can anybody give a solution to me how to remain the data after refreshing the parent page???

tq
Jul 5 '07 #1
5 1878
acoder
16,027 Expert Mod 8TB
tq, welcome to TSDN!

Can you give some example code for the parent and child pages?
Jul 5 '07 #2
i have parent page that consist of two text box to insert name and department.There are also 1 button to open child page.

The code behind for the PARENT PAGE is:

Expand|Select|Wrap|Line Numbers
  1. Partial Class testParent
  2.     Inherits System.Web.UI.Page
  3.  
  4.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  5.         If Not Page.IsPostBack Then
  6.             Response.Cookies("ID").Value = TextBox1.Text
  7.  
  8.             Me.Button1.Attributes.Add("onclick", "window.open('testChild.aspx','myWindow','height=600px,width=700px,top=200,left=200')")
  9.         Else
  10.  
  11.  
  12.         End If
  13.         Me.TextBox1.Text = Trim(Request.Cookies("ID").Value)
  14.  
  15.     End Sub
  16.  
  17. End Class
  18.  
At the child page, user can choose the department.After click submit button,the textbox value for NAME inserted before open the child page are dissapeared.

CODE FOR CHILD PAGE:

Expand|Select|Wrap|Line Numbers
  1. Partial Class testChild
  2.     Inherits System.Web.UI.Page
  3.  
  4.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  5.         If Not Page.IsPostBack Then
  6.             Dim IDGet As String
  7.             IDGet = Request.Cookies("ID").Value
  8.             ''//with this IDGet, run the command and fill ds or whatever and then//
  9.             Me.TextBox1.Text = IDGet
  10.             Dim cScript As String
  11.             cScript = "<script language='javascript'> opener.location.href = 'testParent.aspx'; </script>"
  12.             ClientScript.RegisterStartupScript(Me.GetType, "parentwindow", cScript)
  13.         End If
  14.         Response.Cookies("ID").Value = Me.TextBox1.Text
  15.     End Sub
  16.  
  17.  
  18.  
  19.     Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
  20.     End Sub
  21.  
  22.     Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
  23.         Response.Cookies("ID").Value = Me.TextBox1.Text
  24.         Response.Write("<script>window.close();</script>")
  25.  
  26.     End Sub
  27. End Class
Jul 6 '07 #3
acoder
16,027 Expert Mod 8TB
Hmm..this is VB code. Can you not show the generated source code instead?
Jul 6 '07 #4
Hi, what is generated source code...can u explain to me :)

tq
Jul 9 '07 #5
acoder
16,027 Expert Mod 8TB
Hi, what is generated source code...can u explain to me :)
View source in your browser.
Jul 9 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Joe D | last post by:
I think this is a simple question. But I am new to JS. Here is what I want to do: From a parent window, open a popup window (child) to get data from user, then user submit the request, close the...
7
by: Mike | last post by:
List, I call this a "Parsing Problem", but it could be called formatting or regular expressions as well. I have a set of data that was formerly processed on an OS390 (hence a lot of...
1
by: Reinhold Mannsberger | last post by:
Hello I want to pass data from one page to another, more specifically I want to pass data from a child page to a parent page My parent page (parentpage.htm) does ----...
2
by: dbuchanan | last post by:
Hello, Windows forms & database What are the considerations when choosing how to display reference information from the calling form? What is recommended? Table1 is the parent of Table2. ...
2
by: ads | last post by:
hi guys, Here's the scenario: i have a gridview on a parent page. Then i open another (child) page where i can modify the data on the dridview. How do i update the gridview soon as i do...
2
by: epaetz | last post by:
Is there a way to decouple the linkage between a parent and a child window? Does the parent window have any sort of a collection that holds all the children that it has spawned? I want to...
4
by: Ravi Kishore | last post by:
Hi all, I have a problem while sending the data to and fro a JSP page. When i click a link on a JSP page(say parent.jsp), i have to open a diff page(say child.jsp), get the data from that page and...
4
by: Buddha | last post by:
Hello, I posted this on two forums, without too much help .. and I am kinda stuck in this. I need to refresh the parent page from the second child window which is opened by the first child and...
1
by: doxtor | last post by:
Hi.. I have a form, there is a combo box there name school. Beside there'is a link to open a child window to add a new data school. To open this popup, i use greybox jquery plugin. work ok until...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.