equivalent of ASP.NET MVC TempData in ASP.NET
Asked Answered
P

2

8

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?

Perm answered 1/6, 2011 at 8:2 Comment(1)
Session and Viewstate bai Rob :DPersonalism
S
6

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.

Shipe answered 1/6, 2011 at 8:7 Comment(0)
L
-2

You can use either Session or Viewstate to pass data between pages in ASP.NET application.

Logy answered 1/6, 2011 at 8:15 Comment(5)
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.