ASP.Net MVC 3 - JSON Model binding to array

前端 未结 3 1782
谎友^
谎友^ 2020-12-28 17:32

I am on ASP.Net MVC 3, and going by the feature list supported in at, i should be able to get default json model binding working out of the box. However i havent been succes

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-28 18:00

    Your code looks fine.. But check this

    1. Routing settings.
    2. Put [HttpPost] attribute on SaveDiscount

    and try this

    var catalogDiscount = JSON.stringify( { discounts: jsondatacoll } );
    

    that would give make right data binding.

提交回复
热议问题