how to remove null value in json string

Cacroffgrenna

New Member
Hi I'm using the below class \[code\]Public List<string> name;Public List<string> midname;\[/code\]Once I serialize it I'm getting the following output like\[code\] {"name":[hari],"midname":null}\[/code\]But I want my answer to be like this \[code\]{"name":[hari]}\[/code\]It shouldn't display the class attribute that has null value. And I'm using c# .net framework.
 
Back
Top