How to exclude another attribute in this synthesis [Bind (Exclude = "ID")] in MVC

since I excluded the "ID", how can I exclude another attribute?

+6
asp.net-mvc
source share
3 answers

Exclude accepts a comma separated list of attributes. When parsing, it also trims the inputs, so you can use spaces to make it more readable.

Example:

[Bind(Exclude="ID, Name")] 
+21
source share

[Bind (Exclude = "ID, second")]

+2
source share

Try to separate the attributes you want to exclude with commas, for example

 [Bind(Exclude="ID,Name")] 
+2
source share

All Articles