こんにちは、私はjsonのように見える文字列を送信しようとしています。c#to jsonが表示で正しくレンダリングされない
class Place
{
public string title { get; set; }
public string description { get; set; }
public double latitude { get; set; }
public double longitude { get; set; }
}
List<Place> placeList = new List<Place>();
//add places to PlaceList
//Then i do this
System.Web.Script.Serialization.JavaScriptSerializer oSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
string sJSON = oSerializer.Serialize(placeList);
ViewBag.Places = sJSON;
ビューでは、このかかわらようにそのレンダリング出力::場所のリストを送信する
イム
[{"title":"sdf sdfsd sdf sd f","description":"sdf sdf sd fsd sd sdf sdf dssd sdf sd s","latitude":53.740259851464685,"longitude":-2.4602634343627927},
は、どのように私はそれがビューで通常のJSONとしてレンダリングするのですか?マイナス"
など?
の作品htmlエンコードされた文字列。ビュー内のレンダリングに前処理がないことは確かですか? –
私は試しました:HttpUtility.HtmlDecode(oSerializer.Serialize(placeList)); - 同じ結果 – raklos
私のビュー私は持っている: "場所":@ ViewBag.Places – raklos