ASP.NET MVC - TempData - Good or bad practice

前端 未结 8 2184
南方客
南方客 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:56

    All good answers, have you had a look at this for passing messages along.

    TempData and Session arent the best idea for RESTful architectures as most sessions are stored in memory. So when you want to use a server farm, the users session would exist on one server while their next request could be sent to another server.

    That being said have a look at this use of TempData for passing messages here.

    http://jameschambers.com/2014/06/day-14-bootstrap-alerts-and-mvc-framework-tempdata/

    Mabye this could be adapted to use a query string approach if used only for redirect to another page alerts.

提交回复
热议问题