Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • Action Filter in MVC

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 124
    Comment on it

    An action filter is an attribute which you can apply  over the entire controller or over its particular action.

     

    Action filters in MVC are the attribute that can be used according to the user need before or after the program gets executed.

     

     

    Action filter can be implemented using an ActionFilter attribute.

    Action filters are associated with action performed in controllers before or after the program executes.

     

    using System;
    using System.Web.Mvc;
    
    namespace MvcApplication1.Controllers
    {
         public class DataController : Controller
         {
              [OutputCache(Duration=10)]
              public string Index()
              {
                   return DateTime.Now.ToString("T");
    
              }
         }
    }

     

    Action filter are used when we want to add something before or after the execution of program.

    .net

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: