ASP.NET ,equivalent to PHP Print_r Function?

前端 未结 6 1886
忘了有多久
忘了有多久 2021-01-14 17:50

PHP Print_r is useful to print out array and dictionary collection. is asp.net build in this function??

6条回答
  •  猫巷女王i
    2021-01-14 18:42

    You can achieve it by JavaScriptSerializer

    var json = new JavaScriptSerializer().Serialize(yourObject);
    Response.Write("yourObject:" + json + "
    ");

提交回复
热议问题