public ActionResult Login(Login login, string redirectUrl)
 {
     BackServiceProxy proxy = new BackServiceProxy();
     if (proxy.ForwardLoginRequestToService(login))
     {
         FormsAuthentication.SetAuthCookie(login.Username, false);
         return Redirect(redirectUrl ?? FormsAuthentication.DefaultUrl);
     }
        else
     {
         ModelState.AddModelError("", "Login failed");
         return View();
     }
 }
Exemplo n.º 2
0
 // GET: Home
 public ActionResult Index()
 {
     BackServiceProxy proxy = new BackServiceProxy();
     var serviceResult = proxy.DoSomething(new SomeParameters { Parameter = 99 });
     return View(serviceResult);
 }