简体   繁体   中英

WebForms detailsview — are both Edit and Insert templates needed?

This question would apply to a typical CRUD page allowing the user to ADD, and/or EDIT a specific record.

Question about WebForms DetailsView control (and possibly FormView and GridView) -- Do we really need to specify BOTH the Edit-template AND the Insert-template which are essentially the same? If not, which template should be designed/specified?

Your answer and comments are welcome. Thanks...J.

In my experience you don't have to specify either template. In fact the only time I even use templates is if I want to customize certain attributes that you can only do via a template. I typically use templates when I want to have RequiredFieldValidators. Otherwise I don't use them at all. But you certainly can have neither, either or both.

That being said, I do usually have Item, Insert and Edit templates when I do need the extra flexibility of templates. Seems more complete to me.

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