How To Attach an Attribute to a Method in Visual J# .NET (314626)



The information in this article applies to:

  • Microsoft Visual J# .NET (2002)
  • Microsoft Visual J# .NET (2003)

This article was previously published under Q314626

SUMMARY

This article describes the syntax that you can use to attach a code attribute to a method in Visual J# .NET.

MORE INFORMATION

You can attach code attributes to classes, fields, methods or method parameters by using the following syntax:

/** @attribute type */

The type name that follows @attribute must resolve to an attribute type in the current context. You can either give a fully qualified class name or a simple class name. If you give a simple class name, the import information is used to resolve the type.

For example, to set the Web method attribute in a Web service method, use the following:
/** @attribute System.Web.Services.WebMethodAttribute() */ 
				
Or, in the System.Web.Services context, you can use the following:
/** @attribute WebMethodAttribute() */ 
				

REFERENCES

For more information about attributes and how they are used for declarative security, see the Microsoft Web Help file at the following Microsoft Web site:

For more information regarding Visual J# .NET, see the following Microsoft Developer Network (MSDN) Web site: For more information about Visual J# .NET, visit the following MSDN newsgroup:

Modification Type:MinorLast Reviewed:8/30/2004
Keywords:kbWebServices kbHOWTOmaster KB314626 kbAudDeveloper