Okay you need to take into consideration the mode the DetailsView
is in when attempting to access a control, it will not exist in the hierarchy if it isn't in the edit mode causing the Page_Load
to explode when it is called without the DetailsView
in edit mode. Add some checks to your code to properly handle the control state.
protected void Page_Load(object sender, EventArgs e)
{
if (ABC_DV.CurrentMode == DetailsViewMode.Edit) {
updated_time = (TextBox)ABC_DV.FindControl("txt_updated_time");
if(null != updated_time)
updated_time.Text = DateTime.Now.ToString();
}
}