public ActionResult Index(AuthenticationModel userDetails) { if (ModelState.IsValid) { IAuthenticate authenticationService = AuthenticationFactory.getAuthService(); bool authenticated = authenticationService.Authenticate(userDetails.Username, userDetails.Password); if (authenticated) { FormsAuthentication.SetAuthCookie(userDetails.Username, false); // Forward User to Application Home Page return(RedirectToAction("Index", "Home")); } } // Forward user to Not Authenticated Alert page return(View("NotAuthenticated")); }