ASP.NET MVC - TempData - Good or bad practice

前端 未结 8 2199
南方客
南方客 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 02:54

    I think you do well to hesitate before using TempData. TempData is stored in the session and this may have implications for you if:

    1. You don't use sessions on your site right now
    2. You have a system that needs to scale to high throughput, i.e. you'd prefer to avoid session state altogether
    3. You don't want to use cookies (I don't know how well MVC supports cookieless sessions right now)

    If your site needs to have high availability, then there are additional considerations around applying session state but these are all solvable problems.

提交回复
热议问题