473,473 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

C# - Maintaining form fields values


Form A (Main)
Text Box 1
Text Box 2
Text Box 3

Form B (Pop-up)
Choose a selection for Form A/Text Box 3
Scenario:
1. User fills out the first two fields (Text Box 1 and Text Box 2) on
Form A

2. User clicks on a link for that spawns a pop-up window to choose a
selection that will populate Test Box 3 on Form A

3. After hitting the Submit button the page redirects to Form A
refreshing the page wiping the values from (Text Box 1 and Text Box
2).
Question: What can I do to maintain the values on Form A?


Thanks in advance...
Nov 18 '05 #1
3 2494
If all you want from Form B is just to pass a parameter back to Forma A,
Form B doesn't have to submit to the server. Open Form B from Form A with a
javascript call to showModalDialog and pass the selected value back with
returnValue. Since there won't be any refresh to Form A, the values of Text
Box 1 and 2 will persist.

Eliyahu

"User" <us**@berlin.com> wrote in message
news:ck********************************@4ax.com...

Form A (Main)
Text Box 1
Text Box 2
Text Box 3

Form B (Pop-up)
Choose a selection for Form A/Text Box 3
Scenario:
1. User fills out the first two fields (Text Box 1 and Text Box 2) on
Form A

2. User clicks on a link for that spawns a pop-up window to choose a
selection that will populate Test Box 3 on Form A

3. After hitting the Submit button the page redirects to Form A
refreshing the page wiping the values from (Text Box 1 and Text Box
2).
Question: What can I do to maintain the values on Form A?


Thanks in advance...

Nov 18 '05 #2
Eliyahu, thanks for the fast reply.

My apologizes but I need to elaborate on the process. I will try to
keep this short before it becomes a rat hole.
Form A (Main)
Text Box 1
Text Box 2
Text Box 3
Hidden Field
link to Form B

Note: Form A is a aspx page

Form B (Pop-up)
Choose a selection for Form A: Text Box 3 (For Displaying purposes
only) and a Hidden Field
Note: Form B is a asp page with Radio buttons with values from MS SQL

Scenario:
1. User fills out the first two fields (Text Box 1 and Text Box 2) on
Form A

2. User clicks on a link for that spawns a pop-up window to choose a
selection that will populate Test Box 3 and a Hidden Field on Form A
with a radio button

3. The Submit button is clicked

4.
a. aspx function will read the Request.Querystring
b. capture the value e.g. (10200~Product Name)
c. split the values based on the '~'
d.assigned the values into Text Box 3 (Product Name) and the Hidden
Field (10200) on Form A.

5. Form A values Text Box 1 and Text Box 2 are no longer there

So my new question is, there a better way of doing this or what is
the solution?

Once again thanks

On Sun, 1 Aug 2004 10:40:37 +0200, "Eliyahu Goldin"
<re*************@monarchmed.com> wrote:
If all you want from Form B is just to pass a parameter back to Forma A,
Form B doesn't have to submit to the server. Open Form B from Form A with a
javascript call to showModalDialog and pass the selected value back with
returnValue. Since there won't be any refresh to Form A, the values of Text
Box 1 and 2 will persist.

Eliyahu

"User" <us**@berlin.com> wrote in message
news:ck********************************@4ax.com.. .

Form A (Main)
Text Box 1
Text Box 2
Text Box 3

Form B (Pop-up)
Choose a selection for Form A/Text Box 3
Scenario:
1. User fills out the first two fields (Text Box 1 and Text Box 2) on
Form A

2. User clicks on a link for that spawns a pop-up window to choose a
selection that will populate Test Box 3 on Form A

3. After hitting the Submit button the page redirects to Form A
refreshing the page wiping the values from (Text Box 1 and Text Box
2).
Question: What can I do to maintain the values on Form A?


Thanks in advance...


Nov 18 '05 #3
My suggestion is good for your scenario. You are passing the selection from
form B to form A via round trip to the server in a query string. This is
unnecessary. In form B, upon clicking Submit button, set window.returnValue
to whatever you want and call window.close(). If form B was called as a
modal dialog, form A will get the returnValue as a result value of the
showModalDialog call(). After this call, return value can be assigned to
Text Box 3. You can't program in ASP.NET without a bit of understanding
client-side javascript programming.

Good luck,

Eliyahu

"User" <us**@berlin.com> wrote in message
news:j3********************************@4ax.com...
Eliyahu, thanks for the fast reply.

My apologizes but I need to elaborate on the process. I will try to
keep this short before it becomes a rat hole.
Form A (Main)
Text Box 1
Text Box 2
Text Box 3
Hidden Field
link to Form B

Note: Form A is a aspx page

Form B (Pop-up)
Choose a selection for Form A: Text Box 3 (For Displaying purposes
only) and a Hidden Field
Note: Form B is a asp page with Radio buttons with values from MS SQL

Scenario:
1. User fills out the first two fields (Text Box 1 and Text Box 2) on
Form A

2. User clicks on a link for that spawns a pop-up window to choose a
selection that will populate Test Box 3 and a Hidden Field on Form A
with a radio button

3. The Submit button is clicked

4.
a. aspx function will read the Request.Querystring
b. capture the value e.g. (10200~Product Name)
c. split the values based on the '~'
d.assigned the values into Text Box 3 (Product Name) and the Hidden
Field (10200) on Form A.

5. Form A values Text Box 1 and Text Box 2 are no longer there

So my new question is, there a better way of doing this or what is
the solution?

Once again thanks

On Sun, 1 Aug 2004 10:40:37 +0200, "Eliyahu Goldin"
<re*************@monarchmed.com> wrote:
If all you want from Form B is just to pass a parameter back to Forma A,
Form B doesn't have to submit to the server. Open Form B from Form A with ajavascript call to showModalDialog and pass the selected value back with
returnValue. Since there won't be any refresh to Form A, the values of TextBox 1 and 2 will persist.

Eliyahu

"User" <us**@berlin.com> wrote in message
news:ck********************************@4ax.com.. .

Form A (Main)
Text Box 1
Text Box 2
Text Box 3

Form B (Pop-up)
Choose a selection for Form A/Text Box 3
Scenario:
1. User fills out the first two fields (Text Box 1 and Text Box 2) on
Form A

2. User clicks on a link for that spawns a pop-up window to choose a
selection that will populate Test Box 3 on Form A

3. After hitting the Submit button the page redirects to Form A
refreshing the page wiping the values from (Text Box 1 and Text Box
2).
Question: What can I do to maintain the values on Form A?


Thanks in advance...

Nov 18 '05 #4

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

Similar topics

1
by: Randell D. | last post by:
HELP! I am determined to stick with this... I'm getting there... for those who haven't read my earlier posts, I'm createing what should be a simple function that I can call to check that...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
6
by: allyn44 | last post by:
HI--what I am trying to do is 2 things: 1. Open a form in either data entry mode or edit mode depending on what task the user is performing 2. Cancel events tied to fields on the form if I am in...
0
by: User | last post by:
Form A (Main) Text Box 1 Text Box 2 Text Box 3 Form B (Pop-up) Choose a selection for Form A/Text Box 3 Scenario:
3
by: Bill | last post by:
I'm using the POST method to submit a simple form html page with yes/no and checkbox fields to an asp response page which stores the values in a new dim string, then uses it to build a new table...
7
by: Dan | last post by:
(Using Classic ASP & MS Access) I have a page that has 120 fields on it (mostly checkboxes). I cannot split this into smaller pages. So what i want to do is write a class that handles this. in...
1
by: Dave | last post by:
I have multiple forms that will create an object. Basically a energy efficiency measure object. The measure object will have a couple of required properties set but after that it can have 10-20...
16
rpnew
by: rpnew | last post by:
Hello friends.... I'm developing one project in PHP-MySql on FC4..... I'm facing a problem here at one place. Let me describe it.... I've one page in php on which i'm generating a table...
3
by: Nathan Sokalski | last post by:
I have an UpdatePanel that needs to maintain the value of several TextBoxes with TextMode=Password. Since the browser clears all password fields client-side, I obviously need to use JavaScript 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
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.