In ASP.NET MVC, there's a TempData which can pass data one time from one page to another. What's the equivalent for this in ASP.NET?
equivalent of ASP.NET MVC TempData in ASP.NET
There is no direct equivalent (that is, data that is only passed to the next page).
You can use Session
and clear it out on the receiving page.
You can use either Session or Viewstate to pass data between pages in ASP.NET application.
ViewState
between pages? I don't think so. –
Shipe I suggest you read the article. He is using
Server.Transfer
. This is not the same a loading a new page or doing a redirect. –
Shipe Oded, will it do what @rob waminal asks for or not. I'm not discussing about Responce.Redirect versus Server.Transfer when in this case you right they are different. –
Logy
@eugeneK: I'll be passing some query strings to the called page so Server.Transfer is a no. –
Perm
Then you can save in Cache and Application but this will be global to all application users, so use Session for user specific data. –
Logy
© 2022 - 2024 — McMap. All rights reserved.