NoviceToDotNet
NoviceToDotNet

Reputation: 10805

How to forward data from one page to another

I want to take my data tables data to another page. How can I do this? I am programming in ASP.NET.

Upvotes: 2

Views: 770

Answers (3)

Kris van der Mast
Kris van der Mast

Reputation: 16613

If the data is the same on all pages use the Cache. Otherwise retrieve the data again from the database.

Also you can take a look at this article about possible ways of state management in ASP.NET: Nine Options for Managing Persistent User State in Your ASP.NET Application.

Upvotes: 2

silvo
silvo

Reputation: 4009

You can pass it as a session variable:

Session['yourData'] = dataYouWantToPass;

Then in the next page you retrieve it like so:

var dataYouWantToPass = (YourDataType)Session['yourData'];

In case of string data it would look like this:

//store in session
Session['stringData'] = "Test string data";

//read from session
var stringData= (String)Session['stringData'];

Upvotes: 0

Matin Habibi
Matin Habibi

Reputation: 700

You can use QueryString to pass data.

Upvotes: 2

Related Questions