当前位置: 代码迷 >> ASP.NET >> asp.net在方法前加[]是什么作用解决思路
  详细解决方案

asp.net在方法前加[]是什么作用解决思路

热度:7088   发布时间:2013-02-25 00:00:00.0
asp.net在方法前加[]是什么作用
如:[FormsAuthorize]
 public ActionResult Term()
{}
 [AjaxPro.AjaxMethod]
  public string asd(string sy, string code)
  {
   
  }

写在方法前的[] 是做什么用的?
通常被称为什么?

------解决方案--------------------------------------------------------
定制特性
------解决方案--------------------------------------------------------
特性 看帮助 attribute
------解决方案--------------------------------------------------------
探讨

定制特性

------解决方案--------------------------------------------------------
探讨

定制特性

------解决方案--------------------------------------------------------
叫attribute,给上面的补个链接

http://msdn.microsoft.com/zh-cn/library/system.attribute%28VS.80%29.aspx
------解决方案--------------------------------------------------------
属性定义。
------解决方案--------------------------------------------------------
特性(Attribute)为自己的代码构造添加一些注解时用的,可以带一些参数。特性不是方法,本质上是一个类,如果是自定义的特性类,应继承System.Attribute。
------解决方案--------------------------------------------------------
探讨

特性

反射技术可以用到
  相关解决方案