I never updated the preferences on my blog but I was told that they didn't work correctly by a friend in his .text blog.
Not work correctly? In .text????
I couldn't believe it, so I was had to investigate. Seems there is a little peculiarity to the Admin-->Options-->Preferences form. Two items I (and others) have noticed was that 1) form items convert back to their original values on postback, and 2) post display count does not change.
Easy fix for the postback is to add if (!IsPostBack) in Page_Load(). (Addition in bold)
private void Page_Load(object sender, System.EventArgs e)
{
// if (!AreCookiesAllowed())
// {
...
// }
// else if (!IsPostBack)
// {
if (!IsPostBack)
BindLocalUI();
// }
The Post count was not being processed (i.e., updated in the underlying BlogConfig component) before the Data Layer UpdateConfig method was being executed. Line added in bold.
private void lkbUpdate_Click(object sender, System.EventArgs e)
{
int pageSize = Int32.Parse(ddlPageSize.SelectedItem.Value);
if (pageSize > 0)
Preferences.ListingItemCount = pageSize;
......
BlogConfig config = Config.CurrentBlog(Context);
config.ItemCount = pageSize;
config.EnableComments = this.EnableComments.Checked;
Config.UpdateConfigData(config);
// BindLocalUI();
}