Node is saved as draft in My Content >> Draft
-
Configuring Filters in MVC
Filters in MVC needs to be configured when you need something other to be done which is not provided by its member or methods.
You can configure your own custom filter by the following three ways :
(1) Global level
By registering your filter into the Application_Start event of Global.aspx.cs class with the help of action filter.
protected void Application_Start()
{
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
}
(2) Controller level
By putting your filter on top of the controller name.
Authorize(Roles="Admin")]
public class AdminController : Controller
{
//
}
(3) Action Level
By putting your filter on top of the action.
public class UserController : Controller
{
[Authorize(Users="User1,User2")]
public ActionResult LinkLogin(string provider)
{
// TODO:
return View();
}
}
0 Comment(s)