Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

asp.net-mvc

as I've excluded "ID", how can i exclude another attribute?

like image 892
Vikas Avatar asked Mar 26 '09 12:03

Vikas


3 Answers

Exclude takes a comma-separated list of attributes. When parsed it also trims the inputs so you can use whitespace to make it more readable.

Example:

[Bind(Exclude="ID, Name")]
like image 193
tvanfosson Avatar answered Oct 23 '22 18:10

tvanfosson


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

like image 30
ccook Avatar answered Oct 23 '22 19:10

ccook


Try delimiting the attributes you want to exclude with commas, e.g.

[Bind(Exclude="ID,Name")]
like image 20
Lee D Avatar answered Oct 23 '22 18:10

Lee D