HttpUnauthorizedResult in ASP.NET MVC

The ActionResult can take different values like View , PartialView, String etc,

Another value that it can take is HttpUnauthorizedResult . The HttpUnauthorizedResult when returned from a View will force the user to login in.

HttpUnauthorizedResult in ASP.NET MVC

public ActionResult Index()

{

//var states = ModelState.Values;

//// Error States

//var errorsStates = from m in states

// select m.Errors;

return new HttpUnauthorizedResult();

}
0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.
Pin It

2 thoughts on “HttpUnauthorizedResult in ASP.NET MVC

  1. Pingback: Interesting .NET Links - February 22 , 2013 | TechBlog

  2. Pingback: Interesting .NET Links - March 5 , 2013 | TechBlog

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>