473,324 Members | 2,548 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,324 software developers and data experts.

how to pass value from first form to second form?

Hi,
This is my first time to post asp.net question on this forum.
I have a question for "How to pass the first form value to the next form"
I have enrollinfo.aspx form which look like as follow:
<form id="Form1" method="post" runat="server">
<Subway:Address id="address" runat="server" Caption="Home
Address"></Subway:Address>
<p></p>
<SUBWAY:PEOPLEINFO id="Peopleinfo" runat="server"
Caption="Employee Information"></SUBWAY:PEOPLEINFO>
<p></p>
<asp:hyperlink id=Dependentlink runat="server" text="Add
Dependents" NavigateUrl="Peopleinfo1.aspx?SSN=" >
</asp:hyperlink>
</form>
The address and peopeleinfo are two user controls.(they are textboxes which
will collect some information from users)
When user click "add dependents" link, I want Social security number for a
specific person on this form will be attached
to the Peopleinfo1.aspx, so later on in the database all those dependents
will be attached to this principal person's information. but I don't know how
to check this value if it is filled out/right or not in the second form(
peopleinfo1.aspx),
Any clue? I am just a beginer for asp.net

Thanks
Betty
--
Betty
Jan 11 '06 #1
2 2495
I believe this contains an example that will solve your problem:
http://SteveOrr.net/faq/PassValues.aspx

And here's another nice, simple way to pass values from one page to another:
(VB.NET code)

'Add data to the context object before transferring
Context.Items("myParameter") = x
Server.Transfer("WebForm2.aspx")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.Items("myParameter"),Integer)

Of course there are a number of ways to pass values from one page to another
besides the querystring there are cookies, session, context, saving to a
temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.

Here are more good articles on the subject:
http://www.aspalliance.com/kenc/passval.aspx
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"c676228" <be****@community.nospam> wrote in message
news:5D**********************************@microsof t.com...
Hi,
This is my first time to post asp.net question on this forum.
I have a question for "How to pass the first form value to the next form"
I have enrollinfo.aspx form which look like as follow:
<form id="Form1" method="post" runat="server">
<Subway:Address id="address" runat="server" Caption="Home
Address"></Subway:Address>
<p></p>
<SUBWAY:PEOPLEINFO id="Peopleinfo" runat="server"
Caption="Employee Information"></SUBWAY:PEOPLEINFO>
<p></p>
<asp:hyperlink id=Dependentlink runat="server" text="Add
Dependents" NavigateUrl="Peopleinfo1.aspx?SSN=" >
</asp:hyperlink>
</form>
The address and peopeleinfo are two user controls.(they are textboxes
which
will collect some information from users)
When user click "add dependents" link, I want Social security number for a
specific person on this form will be attached
to the Peopleinfo1.aspx, so later on in the database all those dependents
will be attached to this principal person's information. but I don't know
how
to check this value if it is filled out/right or not in the second form(
peopleinfo1.aspx),
Any clue? I am just a beginer for asp.net

Thanks
Betty
--
Betty

Jan 11 '06 #2
Thank you so much. The information is so through and I will take a look at it.
--
Betty
"Steve C. Orr [MVP, MCSD]" wrote:
I believe this contains an example that will solve your problem:
http://SteveOrr.net/faq/PassValues.aspx

And here's another nice, simple way to pass values from one page to another:
(VB.NET code)

'Add data to the context object before transferring
Context.Items("myParameter") = x
Server.Transfer("WebForm2.aspx")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.Items("myParameter"),Integer)

Of course there are a number of ways to pass values from one page to another
besides the querystring there are cookies, session, context, saving to a
temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.

Here are more good articles on the subject:
http://www.aspalliance.com/kenc/passval.aspx
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"c676228" <be****@community.nospam> wrote in message
news:5D**********************************@microsof t.com...
Hi,
This is my first time to post asp.net question on this forum.
I have a question for "How to pass the first form value to the next form"
I have enrollinfo.aspx form which look like as follow:
<form id="Form1" method="post" runat="server">
<Subway:Address id="address" runat="server" Caption="Home
Address"></Subway:Address>
<p></p>
<SUBWAY:PEOPLEINFO id="Peopleinfo" runat="server"
Caption="Employee Information"></SUBWAY:PEOPLEINFO>
<p></p>
<asp:hyperlink id=Dependentlink runat="server" text="Add
Dependents" NavigateUrl="Peopleinfo1.aspx?SSN=" >
</asp:hyperlink>
</form>
The address and peopeleinfo are two user controls.(they are textboxes
which
will collect some information from users)
When user click "add dependents" link, I want Social security number for a
specific person on this form will be attached
to the Peopleinfo1.aspx, so later on in the database all those dependents
will be attached to this principal person's information. but I don't know
how
to check this value if it is filled out/right or not in the second form(
peopleinfo1.aspx),
Any clue? I am just a beginer for asp.net

Thanks
Betty
--
Betty


Jan 11 '06 #3

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

Similar topics

1
by: jeremylim2000 | last post by:
Hi! For Example, text for Product code, name (both is text) is from form A and I want pass the Product Code, and name to form B using eg. session('txtproduct') & session('txtname'). As in...
6
by: AC | last post by:
This code works great the first few times it is used in a form and then I get the error: 'QUANTITY.value' is null or not an object in IE6. The names used are generated on the server so it is not...
1
by: Dan | last post by:
This is one that has me stumped and I need an expert's input. Any ideas why the values from the second script-generated drop down list isn't recognized by the script to add time values to the...
4
by: Omar Llanos | last post by:
Recently, I posted a question on how to invoke a textbox control in Form1 (parent form) from within Form2 (which is inherited from Form1). Someone suggested to pass a reference of the Form1 to the...
2
by: Chane | last post by:
hi i have doubt in how to pass values back to the called form. I have two forms, each having a textbox and a button control. First i'm run the first form and click the button, it creates object...
4
by: z_learning_tester | last post by:
I'm reading the MS press C# book and there seems to be a contradiction. Please tell me which one is correct, 1 or 2. Thanks! Jeff 1. First it gives the code below saying that it prints 0 then...
2
by: macyp | last post by:
I have to pass values from one aspx page to another. The controls I have in the first page are: a textbox, 3 drop down lists, and 2 check boxes, and a submit button. It is a search page, and the...
3
by: Aussie Rules | last post by:
Hi, I have a few aspx (.net2) form. The first form allows the user to enter into text box, and select values from drop downs The second form needs to use these values to process some data....
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...

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.