Working with JSON on the Server-Side in ASP.NET and C#

前端 未结 2 1941
旧巷少年郎
旧巷少年郎 2021-01-03 12:52

I have an ASP.NET web form that is using JQuery on the client-side. I have a user interface that is building a collection of objects and storing them in JSON. With my client

2条回答
  •  借酒劲吻你
    2021-01-03 13:09

    JSON in the Hidden Field is a valid way to do it, as the data would then be posted to the server. You could then use the System.Web.Script.Serialization.JavaScriptSerializer component to deserialize the data (to a dictionary) and access the data that way. Not 100% sure hhow array data comes out of that process. THere are also other tools like JSON.NET too to parse JSON.

    Another way is via a web service call, but that doesn't go through the page lifecycle.

    HTH.

提交回复
热议问题