The ItemUpdating event does not fire when entering edit mode. You must use the DataBound event to set the correct required text value.
If necessary, you can set the CurrentMode property of the DetailsView element to see if you are editing or displaying.
The result is as follows:
protected void DetailsView1_DataBound(object sender, EventArgs e) { Label l = DetailsView1.FindControl("FirstName") as Label; if (DetailsView1.CurrentMode == DetailsViewMode.Edit) {
Be sure to define the DataBound event in the Detailsview1 control.
SIGN . This may depend on the data binding mode. If so, let me know and attach an example.
Hybos source share