Filters are used to perform logic either before an action method is called or after an action method runs. Filters are custom classes that provide both a declarative and programmatic means to add pre-action and post-action behaviour to controller action methods.
Prior to ASP.NET MVC 5, there are 4 types of filters:
- Authorization filters (IAuthorizationFilter)
- Action filters (IActionFilter)
- Result filters (IResultFilter)
- Exception filters (IExceptionFilter)
Prior to ASP.NET MVC 5 we are using the [Authorization] attribute to enforce role-based security within the ASP.NET MVC applications. ASP.NET MVC 5 introduces the new Authentication filters (IAuthenticationFilter).
Authentication filters are a new kind of filter in ASP.NET MVC that run prior to authorization filters in the ASP.NET MVC pipeline and allow you to specify authentication logic per-action, per-controller, or globally for all controllers. Authentication filters process credentials in the request and provide a corresponding principal. Authentication filters can also add authentication challenges in response to unauthorized requests.
This blog post explains how to change the default location of Views in an ASP.NET MVC project.
public class HomeController : Controller
public ActionResult Index()
ViewBag.Message = "View Engine Demo!";
If we look at the above code snippet, we have a HomeController inside we have an Index action method which is returning a View. If an user request for the following URL http://localhost/Home/Index/ or http://localhost/Home/ ASP.NET MVC goes through the request pipeline, execute Index action method & return a view.
In this example we did not mention any view name & location of view. We know ASP.NET MVC follows conventions rather than configuration. It searches for a view named index (view name will same as action name, if we don’t explicitly mention) in Home folder under Views folder in root of the project.
This is the third article in series of Windows Azure Web Sites, In this article I am going to discuss about continuous deployment from source control to windows azure web sites using local git repository.
Windows Azure Web Sites supports continuous deployment from source control and repository tools like Team Foundation Service, CodePlex, GitHub, Dropbox, Bitbucket, External Repository(Git, Mercurial), and Local Git Repository.
In this article we are going to publish our local Git repository to a remote repository in Windows Azure, and our site will go live quickly and automatically.
This is the second article in series of Windows Azure Web Sites, In this article I am going to discuss about creating a Hello World ASP.NET MVC Web Site & publishing it on Windows Azure Web Site.
To start with Windows Azure Web Sites login to https://manage.windowsazure.com, then go to bottom left corner of portal, we will find a NEW button, click on it.
Last week on April 27th I presented in Global Windows Azure Bootcamp – Hyderabad on Windows Azure Web Sites. In this article I am going share my points on Windows Azure Web Sites, for more information visit Windows Azure Site.
Currently Windows Azure provides 3 different options for hosting applications on cloud.