asp.net - Selective JSON Serialization using ASMX Web Service -
i have webservice use json formatted custom classes, example:
public class custom { private int _myprivateproperty; public int tobeaccessedonlyincode { { return _myprivateproperty; } set { _myprivateproperty = value; } } public int tobeserialized { { return _myprivateproperty * 1000; } } }
the above example illustration purposes.
the problem don't want return original object format in json response, need original format in code.
i have tried [datacontract]/[datamemeber] attributes in class, leaving out tobeonlyaccessedincode property, have tried using [nonserialized] attribute above private object container. no avail.
is there way in can prevent field being serialized json when using built in asmx scriptserializer? i've spent few hours looking , help!
thanks
found it:
[system.web.script.serialization.scriptignore]
Comments
Post a Comment