You set the working mode of the Details View to Insert and go: Figure 1 shows the output you get.
Filling out the form and inserting a record into the database works well.
The Details View control can be bound to a data source control (such as the Sql Data Source control or Object Data Source control) or to any data source collection that implements the IEnumerable interface, such as Data View, Array List, List`1, or other collection types.
To declare the row fields, first set the Details View. When both are used, explicitly declared row fields are rendered first, followed by the automatically generated row fields.
Validation server controls are also provided to assess user input. Auto Generate Insert Button properties to true, respectively.
For more information, see Script Exploits Overview.
You can customize the user interface of the Details View control to a large extent.
You can choose the most appropriate combination of data fields to render each piece of information conveniently.However, in the long list of events fired by the Details View control, there s one that you can leverage to implement a little piece of logic to set default input values.The Details View control exposes several events that enable the developer to execute custom code at various times in the lifecycle.The Item Created event is fired immediately after a Details View item is created. When the Details View control is bound to a data source control, the Details View control can take advantage of the data source control's capabilities and provide automatic updating, deleting, inserting, and paging functionality. Input controls that are appropriate for the field's data type (such as a Text Box or a Check Box control) are displayed with a field's value for the user to modify.These features are provided out-of-the-box and are not configurable by programmers.