Wednesday, October 7, 2009

More on MVC

To redirect to another URL, simply return the Redirect function
eg: return Redirect("INSERT_URL_HERE");

MVC allows 1 to use the current http context for validation; As a check on whether the user has logged on or not.

   25             if (HttpContext.User.Identity.IsAuthenticated)


   26             {


   27                 //View my previous blog @ http://zacthetechie.blogspot.com/2009/10/mvc-with-web-services.html


   28                 //on how to access a web service from MVC.


   29                 return View();


   30             }


   31             else


   32             {


   33                 return RedirectToAction("LogOn", "Account");


   34             }


No comments:

Post a Comment