Tip #1 - Using AjaxPro.AjaxNoTypeUsage

Tags: AJAX, Ajax.NET, ASP.NET, JavaScript

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.