i

ASP.Net A Complete Guide

FormView

It is used to displays the values of a single record from a data source using user-defined templates. The FormView control allows us to edit, insert, and delete records.

This control is by default, located in the Visual Studio toolbox, inside the Data tab. If you place FormView control to a web form, you'll see that it does not appear very user-friendly at first look. There is an only gray rectangle, like in the image below:

 

Syntax:

 

                                 Methods of FormView Control  

Property

Description

 

 

ChangeMode

ReadOnly/Insert/Edit.

InsertItem

We can use it to insert the record into the database.

UpdateItem

We can use to update the current record into the database

DeleteItem

We can use it to delete the current record from the database.