Syntax
CSharp
public GenerateScriptTypeAttribute (
Type type
)
VisualBasic
Public Sub New ( _
type As Type _
)
ManagedCPlusPlus
public:
GenerateScriptTypeAttribute (
Type^ type
)
JSharp
public GenerateScriptTypeAttribute (
Type type
)
Parameters
- type (Type)
The Type to include in the proxy class.
Remarks
The ScriptTypeId property is an optional named parameter for this constructor.
Examples
The following example demonstrates how to use GenerateScriptTypeAttribute to generate a proxy object for the specified type that uses a specific type identifier for the metadata marker.
CS
[GenerateScriptType(typeof(ColorObject),
ScriptTypeId = "Color")]
[WebMethod]
public string[] GetDefaultColor()
{
// Instantiate the default color object.
ColorObject co = new ColorObject();
return co.rgb;
}
VB
<GenerateScriptType(GetType(ColorObject), ScriptTypeId:="Color")> _
<WebMethodAttribute()> _
Public Function GetDefaultColor() As String()
' Instantiate the default color object.
Dim co As New ColorObject()
Return co.RGB
End Function
Permissions
Exceptions
Assembly: System.Web.Extensions (Module: System.Web.Extensions)