简体   繁体   中英

ASP.NET 4.5: Attribute 'modeltype' is not a valid attribute of element 'FormView'

I am building an ASP.NET Web Form in VS 11 & want to use Model Binding feature of ASP.NET 4.5. The problem is that the ModelType attribute of FormView tag is not shown in the Intellisense list. If I try to type it manually in the source, I will get the following message:

Validation (ASP.Net): Attribute 'modeltype' is not a valid attribute of element 'FormView'

What could the problem be?

Solved

The problem was that ModelType attribute (new in ASP.NET 4.5) - which is introduced in contributors' blogs across the Internet so many several times - has been renamed to ItemType without any notice. One can find it in Properties Palette of Data Controls in VS 11.

I wonder why it is not mentioned anywhere in the documentations and blogs.

Cheers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM