MVC 3 doesn't bind nullable long

前端 未结 5 1450
执笔经年
执笔经年 2021-02-03 10:04

I made a test website to debug an issue I\'m having, and it appears that either I\'m passing in the JSON data wrong or MVC just can\'t bind nullable longs. I\'m using the latest

5条回答
  •  清酒与你
    2021-02-03 10:40

    I created a testproject just to test this. I put your code into my HomeController and added this to index.cshtml:

    
    

    I put a breakpoint in the GetData method, and the values were binded to the model like they should:

    enter image description here

    So I think there's something wrong with the way you send the values. Are you sure the "TestLong" value is actually sent over the wire? You can check this using Fiddler.

提交回复
热议问题