protected void AddDoctorDataSource_Inserting(object sender, LinqDataSourceInsertEventArgs e)
    {
        // get the date picker
        var datePicker = ((TemplateControls_DatePicker)AddDoctorFormView.FindControl("DateOfBirthDatePicker"));

        // set the date of birth
        ((Doctor)e.NewObject).DateOfBirth = datePicker.SelectedDate;
    }
 private void ClearForm()
 {
     ((TextBox)AddDoctorFormView.FindControl("NameTextBox")).Text    = "";
     ((TextBox)AddDoctorFormView.FindControl("LicenseTextBox")).Text = "";
     ((TextBox)AddDoctorFormView.FindControl("AddressTextBox")).Text = "";
     ((DropDownList)AddDoctorFormView.FindControl("GenderDropdownList")).SelectedIndex = 0;
     ((TemplateControls_DatePicker)AddDoctorFormView.FindControl("DateOfBirthDatePicker"))
     .SelectedDate = DateTime.Now.Ticks;
 }