Database Reference
In-Depth Information
Figure 9.34
Conigure FormView1 properties.
Figure 9.35
Conigure label properties.
TASK 3: IMPLEMENT ACTIONS
At this point, the web form has been designed. he next task is to add code to implement
some actions to be performed by the web form. To do so, follow the steps below:
1. he irst action is to make the FormView display the irst record presented in the
GridView while loading the web form. To do so, we need to make the SelectedIndex
of the GridView to be set as 0. In the Solution Explorer pane, double click the ile
Default.aspx.cs to open it. Rewrite the code for the Page_Load function with the
code
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
GridView1.SelectedIndex = 0;
}
as shown in Figure 9.36.
2. To display the status of the update action, add the following code for the FormView1_
ItemUpdated method as shown in Figure 9.37:
Search WWH ::




Custom Search