Dave Burke : Freelance .NET Web Developer specializing in Online Communities

.Text 0.95 Preferences fix

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();
}

  

Comments (6) | Post RSS RSS comment feed

Posted on 1/18/2005 7:16:00 AM by Dave Burke
Categories:
Tags: no tags for this post

Related posts

Comments (6) -

1/23/2005 3:06:00 AM Permalink

Hi, does your .Text source have scheduled events? If so, can you put up your .Text source for download?

Chee Wee |

1/23/2005 6:23:00 AM Permalink

No, but I think the 0.96 source does from what I've seen of it.

Dave Burke |

1/23/2005 6:32:00 AM Permalink

Sigh... The 0.96 source is problematic and it's not easy to create users or migrate users over from 0.95.  In addition, it appears to have no way of going into any of the admin pages via login.

Chee Wee |

1/23/2005 6:35:00 AM Permalink

Chee, So you've already seen it?  That's neat!  Yes, 0.96 is a bit different from 0.95, isn't it?  What I plan on doing is getting pieces of it to support the Lucene-based searching component, which I believe includes the scheduler functions of 0.96.  I'll be doing that (or at least TRYING to do that) in the next few weeks and will be definitely blogging about the experience.

Dave Burke |

1/23/2005 6:39:00 AM Permalink

Chee Wee actually, not Chee. ;o) My last name is Chua, which I seldom use.

I got the 0.96 (which is actually 0.958 - can't remember the full version number, which I think is slightly later than 0.958.2004.214) from the SourceVault site, but it's terribly difficult to use.

It appeared to me that there is a lot of people over the world already using it. I wonder where they got the source from. Searching for ""0.958.2004.214"" over the Internet reveals plenty of sites running it already.

Chee Wee |

1/23/2005 6:41:00 AM Permalink

Sorry on the name.  I often see firstname lastname as the poster, so I assumed.  Thanks for the correction.

Good tip on searching for 0.958...  I might have to do that.  Yes, I'll be following the 0.9x movement, too.  

Thanks very much for visiting and for you comments!

Dave Burke |


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke