ASP.NET MVC - TempData - Good or bad practice

前端 未结 8 2200
南方客
南方客 2020-11-28 02:24

I\'m using the AcceptVerbs method detailed in Scott Gu\'s Preview 5 blog post for dealing with form entries in ASP.NET MVC:

  • User gets an empty for
8条回答
  •  青春惊慌失措
    2020-11-28 03:08

    It's like using ViewData, meaning it's probably not a security risk. But i would rather use ViewData than TempData. Check here for a comparason: http://www.squaredroot.com/2007/12/20/mvc-viewdata-vs-tempdata/

    Depending on the design, you could always store the user / basket or whathever you need in the tempdata in the database and just have a "IsReady" field which indicates if its completed or not, making it extensable for later if you want to take in mind, that people can close their browsers.

提交回复
热议问题