Sunday, March 11, 2012

Passing Complex Types

You need to include that type with a ScriptIncludeAttribute on your webservice. ASP.NET AJAX doesn't make all types available, that would be unwieldy. So, you have to "opt-in" a type via this attribute.

http://ajax.asp.net/docs/mref/T_System_Web_Script_Services_ScriptServiceAttribute.aspx

Normally types referred to by a webservice are automatically included (such as types of parameters, return values, etc). Sometimes the type you want isn't explicitly in the webservice signature, so theres the attribute.


If your type isn't in the method signature, you can make it available in the client script using the GenerateScriptTypeAttribute.

http://ajax.asp.net/docs/mref/T_System_Web_Script_Services_GenerateScriptTypeAttribute.aspx

HTH,

MaĆ­ra

No comments:

Post a Comment