473,388 Members | 1,423 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,388 software developers and data experts.

Passing Information From one Form To Another

I'm trying to develop a lookup form in asp.net (vb), when a button is
clicked a small search form will open in a second window which will display
a list of values. When a value is selected the clicking oF a button on this
form will close the window and return the value to the original form.

I've used VS2003 to create an ASP.NET application into which I added
webform1.aspx & webform2.aspx, the code behind these forms is below;

The Parent Form

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
v1 = TextBox1.Text

Dim popupScript As String = "<script language='javascript'>" &
"window.open('webform2.aspx', 'CustomPopUp', " & "'width=600, height=400,
menubar=no, resizable=no, top=200, left=200')" & "</script>"

Page.RegisterStartupScript("PopupScript", popupScript)

End Sub

v1 is defined as a public string in an attached module.

The Search Form

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

TextBox1.Text = v1

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

v1=textbox1.text;

Dim popupScript As String = "<script language='javascript'>" &
"window.opener.location.href=window.opener.locatio n.href;window.close()" &
"</script>"

Page.RegisterStartupScript("PopupScript", popupScript)

End Sub

When data is entered into a textbox on the parent form and the button is
clicked the small search window opens and the data is displayed in its
textbox. If I make changes to the data and then click its button the window
closes but no data is displayed in the original textbox.


Jul 21 '05 #1
0 1280

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Dave Smithz | last post by:
Hi there, I have a situation where I want to have multiple submit buttons on the same form and therefore want to use a redirection php script that checks the value associated with the submit...
3
by: Simon Harvey | last post by:
Hi, In my application I get lots of different sorts of information from databases. As such, a lot of information is stored in DataSets and DataTable objects. Up until now, I have been passing...
4
by: thawk | last post by:
I have tried to pass information from one form to another using the described method in the documentation, but everytime I attempt to do this I get an error message that states that I have a null...
6
by: Max | last post by:
Last time I tried to explain this on another forum it didn't go too well, so I'll try my best and if you know what I'm talking about then please tell me how to do this. I have a class, inside I...
7
by: Drum2001 | last post by:
I am creating a database to track employee time. I have created a form that allows them to select from a combo box their task, enter their hours, and add any comments they may have. In the...
2
by: whitc26 | last post by:
Let me preface: I'm a novice, and have no programming experience. I have created an access database and have a few tables in it. I have created a form called "clients" This form opens up and...
7
by: AMP | last post by:
Hello, I have this in form1: namespace Pass { public partial class Form1 : Form { public Form2 form2; public Form1() {
7
by: The Doctor | last post by:
A rather elementary question, In VB5, how can I pass a variable from one form to another?
1
by: rfr | last post by:
I have a need to use a single version of a Visitor Response Feedback Form on numerous HTML documents. Rather than have numerous versions of this, one on each HTML document, it makes more sense to...
4
by: John Sheppard | last post by:
Hello there I was wondering if anyone could help me, I am trying to pass a typed dataset to a dialoged child form by reference. I have binding sources sitting on the child form. So to refresh...
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:
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.