How to forward data from one page to another
I want to t开发者_如何学JAVAake my data tables data to another page. How can I do this? I am programming in ASP.NET.
You can use QueryString to pass data.
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.
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'];
精彩评论