将tempdata从businesslogic类抛到控制器

时间:2014-06-10 04:07:29

标签: asp.net-mvc tempdata

我的businesslogic类中有这样的代码:

    if (userList != null) {
         pass = userList.Password;
    }
    else
    {
          var context = new RequestContext(
          new HttpContextWrapper(System.Web.HttpContext.Current),
          new RouteData());
          var urlHelper = new UrlHelper(context);
          var url = urlHelper.Action("Login", "Account");
          // how to throw tempdata like this to: TempData["message"] = "Error";
          System.Web.HttpContext.Current.Response.Redirect(url);
      }

我可以将businessdic类的tempdata抛给控制器吗?

0 个答案:

没有答案