November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
public override void ApplyEditChanges()
{
PageData writableClone = this.CurrentPage.CreateWritableClone();
writableClone.Property[Name + "BannerBackground"] = new PropertyString(_textboxBackgroundUrl.Text);
writableClone.Property[Name + "BannerWidth"] = new PropertyString(_textboxWidth.Text);
writableClone.Property[Name + "BannerHeight"] = new PropertyString(_textboxHeight.Text);
/*PropertyDataCollection clonedProperties = Properties.CreateWritableClone();
clonedProperties[Name + "BannerBackground"] = new PropertyString(_textboxBackgroundUrl.Text);
clonedProperties[Name + "BannerWidth"] = new PropertyString(_textboxWidth.Text);
clonedProperties[Name + "BannerHeight"] = new PropertyString(_textboxHeight.Text);
*/
/*
Properties[Name + "BannerBackground"] = new PropertyString(_textboxBackgroundUrl.Text);
Properties[Name + "BannerWidth"] = new PropertyString(_textboxWidth.Text);
Properties[Name + "BannerHeight"] = new PropertyString(_textboxHeight.Text);
SetValue("1");
*/
}
In all 3 cases, the PropertyDataCollection is updated with 3 new properties, but no data is persisted to the DB. Calling base.ApplyEditChanges throws an NullPointerException.
I think it's time for Reflektor :)
Properties[Name] = _textbox1.Text; Properties[Name + "_extra1"] = _textbox2.Text; Properties[Name + "_extra2"] = _textbox3.Text;
should beProperties[Name] = new PropertyString(_textbox1.Text); Properties[Name + "_extra1"] = new PropertyString(_textbox2.Text); Properties[Name + "_extra2"] = new PropertyString(_textbox3.Text);
2) The PropertyDataCollection is updated with the new keys and values, but it seems that this is not persited in the Database. When page is reloaded after saving, the properties are not in the collection anymore! A bug, or is there another way of persisting the data ? I tried to clone the PropertyDataCollection by usingPropertyDataCollection clonedProperties = Properties.CreateWritableClone(); clonedProperties[Name + "BannerBackground"] = new PropertyString(_textboxBackgroundUrl.Text); clonedProperties[Name + "BannerWidth"] = new PropertyString(_textboxWidth.Text); clonedProperties[Name + "BannerHeight"] = new PropertyString(_textboxHeight.Text);
but without luck. Any advice ?