سؤال

I'm using MVC3 with form authentication. Everything work fine except one thing. I want to redirect authenticated user to another page when he/she tries to access LogOn page again. So how can I achieve this?

هل كانت مفيدة؟

المحلول

In your LogOn Action do something like this.

if (HttpContext.Request.IsAuthenticated)
{
   return RedirectToAction("Action", "Controller");
}

return View();
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top