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

I have a form with a select box.

The linq object has selectList as a public property.

I am currently excluding it from an object like this

[Bind(Exclude = "taskDeadlineTime")] 

Now I want to add a second snapshot, and I get this error when trying UpdateModel ()

 No parameterless constructor defined for this object. 

Is it right that I have to add this new property to the bind exception list?

If so, how do I add a few properties to the list?

+4
source share
1 answer

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

Complete documents:

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

+8
source

All Articles