data pass from one page to another page

 Hi,

If i have a 3/4 pages and i want to pass the values of the forms and at last i save the data of the forms. Let , my each page contains about 10 values, and user can go previous page to edit. Finally, all the data of the forms are saved. I know Session , but which is the best practice for this?

Thanks..


naqib
dotNet Coder
0
naqib
7/20/2008 7:53:31 PM
📁 asp.net.web-forms
📃 93655 articles.
⭐ 3 followers.

💬 2 Replies
👁️‍🗨️ 1092 Views

You have the answer: Session.

You can do this:

Session["data1"] = data1value;

Session["data2"] = data2value;

And on the page where it is needed, go:

decimal price = (decimal)Session["price"];

The casting is necessary. Store each field in the Session, don't be tempted to store a web control (like a gridview) in the Session. This'll cause major performance problems as the grid won't be garbage collected by the runtime.

Lastly, don't put too much info in the Session. If you need to store more data, consider using a table in the database for temp data.

0
HeartattacK
7/20/2008 8:58:52 PM
Thanks a lot
naqib
dotNet Coder
0
naqib
7/21/2008 2:29:25 AM
Reply: