There are cases where you want to limit/restrict the properties of a model that is submitted to the server.
Model class :
[Bind(Exclude="Rid")] ---- Rid properties is excluded from model. public class ReviewModel { public int Rid { get; set; } -- AutoGenerated ,User need not submit it public String RName { get; set; } public String RLocation { get; set; } public int Rating { get; set; } }
In the above example,Rid is Auto generated and user need not submit it when posted from View. Rid is excluded by using Bind attribute annotation.