Ankit Kumar
What is the use of NonActionAttribute in Asp.Net MVC?
By Ankit Kumar in ASP.NET MVC on Sep 11 2012
  • Anil Kesana
    Jun, 2015 15

    If you decorated action method with [NonAction] attribute you can't access that through URL.We can restrict this by using private also,but in some scenarios we need public access so by decarating with [NonAction] attribute we can prevent.

    • 2
  • Jignesh Trivedi
    Apr, 2014 24

    This is indicate that a controller method is not an action method.Example: [NonAction] public void IndexTest() { // Do some thing } this is very useful attribute when visibility of controller 's method cannot be changed to private.

    • 1
  • Arulselvan P
    Feb, 2016 2

    [NonAction]public ActionResult About(){ViewBag.Message = "Your application description page.";return View();}

    • 0
  • Jignesh Trivedi
    Apr, 2014 14

    This is the action filter attribute, used to indicate this method of controller is not an action method.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS