ASP .NET MVC NonAction meaning

后端 未结 10 1706
没有蜡笔的小新
没有蜡笔的小新 2021-01-03 17:39

Can anybody please tell me why should I use NonAction? I mean say I have a form with several submit values: Update, Delete or Insert. Since all the submit buttons have the s

10条回答
  •  情歌与酒
    2021-01-03 18:27

    It's an attribute which is used on the methods which are defined by public access modifiers. Actually MVC Framework treats all public methods as URLs but in case you don't want this then you have to decorate a method with the non action attribute. The same thing may be achieved by making the method private.

    An example of NonAction Attribute is given below. http://yogeshdotnet.com/non-action-attribute-in-mvc/

提交回复
热议问题