且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

绑定排除不工作模型绑定在ASP.Net MVC的子对象

更新时间:2023-02-16 16:56:42

嘿,我对面的同样的问题绊倒。是否有仍然没有解决方案?

Hey I just stumbled across the same issue. Is there still no solution for that?

我现在的解决方法是innitialize的childobject并设置可忽略不计为有效值(在我的情况下,它是将被innitially设置为-1整数属性),这部作品的属性,但我宁愿prefere正常绑定(不含)解决方案。

My workaround right now is to innitialize the childobject and set the property that shall be ignored to a valid value (in my case it is an integer property which will be innitially set to -1) this works, but I'd rather prefere the normal Bind(Exclude) solution.