我已經嘗試過這樣的,但在JS函數不調用如何通過升C列出對象到Java腳本函數?
初始:
@{
List<CmsSite.Models.Category> category_list = (List<CmsSite.Models.Category>)ViewData["categories_details"];
}
傳球給js函數:
<button onclick="InsertNewProduct(@Json.Encode(category_list))">Save</button>
js函數:
function InsertNewProduct(arr) {
json_obj = {
//what to do here
}
現在常用3是JSON對象的數組
我看不到List<CmsSite.Models.Category> category_list
的值
我應該如何解碼這個JS?
我有編輯quastion,現在我得到的對象 – user1310492 2013-03-13 12:57:57