YouareimplementinganASP.NETpage.Client-sidescriptrequiresdata.YourapplicationincludesaclassnamedPersonwithaNamepropertyoftypestring.Thecode-behindfileofthepageincludesthefollowingcodesegment.YouneedtousetheJavaScriptSerializerclasstoserializeonlytheNamepr

题目

YouareimplementinganASP.NETpage.Client-sidescriptrequiresdata.YourapplicationincludesaclassnamedPersonwithaNamepropertyoftypestring.Thecode-behindfileofthepageincludesthefollowingcodesegment.YouneedtousetheJavaScriptSerializerclasstoserializeonlytheNamepropertyofeachiteminthepeoplelist.Whichcodesegmentshouldyouuse?()

A.JsonValue=json.Serialize(people.Select(p=>p.Name));

B.varnames=frompersoninpeopleselectperson;JsonValue="{"+json.Serialize(names)+"}";

C.JsonValue=json.Serialize(people.SelectMany(p=>Name.AsEnumerable()));

D.varnames=frompersoninpeopleselectperson;JsonValue=json.Serialize(names);


相似考题