How pass objects from one page to another on ASP.Net Core with razor pages?

后端 未结 5 1477
悲哀的现实
悲哀的现实 2020-12-15 17:59

I\'m developing a web application using Asp.net core 2.0 with razor pages. I\'m creating an object with some data and want to send that object to another page.

Actua

5条回答
  •  情深已故
    2020-12-15 18:36

    You can use the TempData decorator. It is available as a decorator or as a dictionary and its purpose is to keep an object between requests. In the background, the value is stored in a cookie or in the user session, at your choice. You can see more details about its use in the links below:

    TempData at Microsoft Documentation
    TempData in Learn Razor Pages (more practical)

提交回复
热议问题