views:

629

answers:

0

Hello,


I’m trying to learn the inner workings of DetailsView object when operating in Insert mode, but it’s a bit confusing.


1) Assume DetailsView is bound to ObjectDataSource:


A) When DetailsView’s field only defines ItemTemplate and EditItemTemplate, but no InsertItemTemplate, then when control is put into Insert mode, field is rendered using EditItemTemplate as a blueprint.

Wouldn’t it made more sense for Asp.Net to raise an exception if control is put into Insert mode and it doesn’t have InsertItemTemplate defined, since the lack of definition for InsertItemTemplate should suggest that programmer perhaps didn’t intend for that particular field to operate in Insert mode?


B) Assume field only has ItemTemplate and EditItemTemplate defined, and that EditItemTemplate contains several Bind() methods ( which essentially create two-way link ).

Now if we put DetailsView into Insert mode, this field is rendered using EditItemTemplate as its blueprint, meaning it also includes any Bind() methods declared inside EditItemTemplate.

Since Bind() also retrieves data, but field in Insert mode should only commit data, I would assume that in Insert mode Bind()’s functionality is somehow limited? If so, how exactly does Asp.Net prevent Bind() from retrieving data?


C) Assuming field uses EditItemTemplate as a blueprint for Insert mode, is field ( in Insert mode ) rendered exactly the same as when it is in Edit mode ( besides Bind(), the functionality of which is limited to commit operations ), or are certain elements/expressions (or their functionality) omitted/limited?


Thanx