protected void SaveButton_OnClick(object sender, EventArgs e) { if (ValidateDataSource()) { LevelOneDataSource.SaveValues(false); } }
protected override object SaveControlState() { if (LevelOneDataSource != null) { LevelOneDataSource.SaveValues(true); } return(base.SaveControlState()); }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); // Normally only in OnUnload. Call here only to provide diagnostic output LevelOneDataSource.SaveValues(true); var hasLevelOneInstance = CurrentFunction.RootObject != null; var hasLevelTwoInstance = hasLevelOneInstance && CurrentFunction.RootObject.ReferenceValue != null; var hasLevelThreeInstance = hasLevelTwoInstance && CurrentFunction.RootObject.ReferenceValue.ReferenceValue != null; Stack.Text = ""; Stack.Text += string.Format("LevelOne: HasInstance = {0}, IsDirty = {1}<br/>", hasLevelOneInstance, null); Stack.Text += string.Format("LevelTwo (LevelOne.ReferenceValue): HasInstance = {0}, IsDirty = {1}<br/>", hasLevelTwoInstance, LevelTwoDataSource.IsDirty); Stack.Text += string.Format("LevelThree (LevelOne.ReferenceValue.ReferenceValue): HasInstance = {0}, IsDirty = {1}<br/>", hasLevelThreeInstance, LevelThreeDataSource.IsDirty); }
private bool ValidateDataSource() { PrepareValidation(); return(LevelOneDataSource.Validate()); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); LevelOneDataSource.BusinessObject = (IBusinessObject)CurrentFunction.RootObject; LevelOneDataSource.LoadValues(IsPostBack); }