开发者

How to Bind Exclude more than one property from a model with linq to sql asp.net mvc

I have a form with a select box on it.

开发者_运维问答

The linq entity has a selectList as a public property on it.

I'm currently excluding it from the entity like this

[Bind(Exclude = "taskDeadlineTime")]

I now want to add a second drop down, and I'm getting this error when I try to UpdateModel()

No parameterless constructor defined for this object.

Is it right that I should be adding this new property to the bind exclude list?

If so how do I add more than one property to the list?


Exclude takes a comma separated list of property names, just add another.

Complete Docs:

http://msdn.microsoft.com/en-us/library/system.web.mvc.bindattribute.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜