Tip #1 - Using AjaxPro.AjaxNoTypeUsage
If you want to hide name and assembly details of classes you return in your AjaxMethod simple add the AjaxPro.AjaxNoTypeUsage attribute as meta information:
[AjaxPro.AjaxNoTypeUsage] public class MyReturnValue { public string FirstName; public int Age; public bool IsMarried; }
Adding this will remove the JSON property __type from the result value. You will save some bytes (i.e. if used in arrays) and get rid of internal information of your namespace and assembly name conventions.
// before var json = {__type:"MyNamespace.MyClass,MyAssemnly",
Firstname:"Michael",Age:29,IsMarried:true}; // after var json = {Firstname:"Michael",Age:29,IsMarried:true};
2 Comments
Comments have been disabled for this content.
INeedADip said
Excellent...I was hoping there was a way to do that but just learned to live with it.
Tim said
Nice. Is there a way to set this in the web.config so that we don't have to do this for every method?