I have an object that inherits from UserControl. I want to seralize certain properties in this object using JavaScriptSerializer (or another method that does the same thing). Unfortunatly, if I try to seralize the control itself, I get a crash.
I am forced to make another object that contains all the properties that need to be seralized. The properites in my control then refrence the properties of that object. Though this works, it leaves my control with a bunch of properties which are effectively nothing more than pointers to another object that exists soley to make javascript seralization to work.
Is there way around this? I want to be able to use JSON on a usercontrol and be able to specify which properties I want seralized to JSON.
Try using the ScriptIgnore attribute in the properties you don't want to be serialized.
Hope this helps,
Elias.
I tried to override every virutal property on usercontrol and I still got "Cannot get inner content of because the contents are not literal."Something in my base class (usercontrol) seems to be causing problems
No comments:
Post a Comment