我处理控制器的BeginExecute方法,并且我想在此函数中使用RedirectToAction。但是返回的Type不兼容。我该怎么办?这是我的代码:
protected override IAsyncResult BeginExecute(RequestContext requestContext, AsyncCallback callback, object state)
{
byte[] ssVersionNo = (byte[])System.Web.HttpContext.Current.Session["VersionNo"];
string userName = System.Web.HttpContext.Current.Session["UserName"].ToString();
Employee emp = _employee.GetByUserName(userName);
if (!emp.VersionNo.SequenceEqual(ssVersionNo))
{
//I want to throw away in this? how?
return RedirectToAction("LogOff", "Authen");
}
return base.BeginExecute(requestContext, callback, state);
}