By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,012 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

how to pass value from first form to second form?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.