Click here to Skip to main content
15,912,977 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good Morning Friends,
I have 3 forms on 3 different pages now what I want to do is when the user fills the first page I have provided next button to jump on the next page so I want to take the data of 1st page to the 2nd page,So can anybody help for doing this.
Best Regards,
Santosh More
Thanking You in advance.
Posted
Comments
[no name] 4-Jun-12 1:30am    
whats ur data ?? r u fetching data from database..if yes then showm us ur table structure
deepureddy18 4-Jun-12 1:42am    
using query string u can pass the values from one page to other page. like
response.redirect("~/default.aspx?para1="+textbox1.text +"¶2="+textbox2.text);
in dafault.aspx page
string a =request.Querystring["para1"];
string b =request.querystring["para2"];

You need to store the data somewhere, so it is available later. There are three basic options, in increasing lifetime:

1) Session variables
2) Cookies
3) Database

Most websites use a combination of these.

Session Write Read:
C#
DataType myValue = (DataType)Session["SessionVariableNameHere"];

Session Read Write:
C#
Session["SessionVariableNameHere"] = myValue;


Cookie Write:
http://msdn.microsoft.com/en-us/library/aa287547(v=vs.71)[^]
Cookie Read:
http://msdn.microsoft.com/en-us/library/aa287533(v=vs.71).aspx[^]

Database read / write is more complex as it depends on what database systems are available to you.

[edit]:doh: Read/write round wrong way - OriginalGriff[/edit]
 
Share this answer
 
v2
if you use session for transferring data, it use your local resources like your server ram that obviously not a good ID when you can use an easy to use collections like querystring, or if you interest in SEO , use url routing, this link can help you:
this is a Microsoft link[^]
and this is a code project article about routing:
URL Routing with ASP.NET 4.0[^]
 
Share this answer
 
You can use the Query string to do this functionality..

Pass a Querystring value from first page, on next button and accept that value on second page...then get data based on this querystring value from database..!

And fill those values in the controls..that will solve your problem..!
 
Share this answer
 
You can Use Two Methos

1>> Using Session You can pass value from one form to another..

In Form1
C#
Session["Name"] =txtName.Text;
 Session["LatName"]=txtLatName.text;

In Form2

C#
string Name = Session["Name"].ToString();
 String LastName=Session["LatName"].ToString();



Or You can Use

In Form1;
C#
int StudiID=txtStudio.text;
 Response.Redirect("Default.aspx?iStudioID=" + iStudioID);


In Form2
C#
int StudioID = Convert.ToInt32(Request.QueryString["iStudioID"].ToString());
 
Share this answer
 
u can use querystring, sessions for this. or if you save data when you jump on another page than you reterive your previous page data from database.
use any option as you like.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900