How to use Bind Prefix?
Posted
by chobo2
on Stack Overflow
See other posts from Stack Overflow
or by chobo2
Published on 2009-08-23T01:38:22Z
Indexed on
2010/06/06
13:22 UTC
Read the original article
Hit count: 238
asp.net-mvc
Hi
Say if I had this table in my db: Product
It had
ProductId
ProductName
ProductType
Now for whatever reason I can't name my textboxes ProductName and ProductType so now my View Method would look like this
public ViewResult Test([Bind(Exclude ="ProductId")] Product)
So now through my playing around nothing would be matched in this product since they have different names.
So I guess this is where Prefix would come in but I don't know how to use it. Nor how do I use it and Exclude at the same time.
Can someone give me an example?
© Stack Overflow or respective owner