ASP.NET MVC - TempData - Good or bad practice

前端 未结 8 2203
南方客
南方客 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 have a GetModel method which first checks for TempData["model"] and returns that. Otherwise GetModel loads the appropriate data from the database.

    It saves an extra load from the database when I have an action that needs to return a different view that requires the same model data.

提交回复
热议问题