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?
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.
Thanks a lot