/// <summary> /// Binds the threads from the database to the list control /// </summary> /// <param name="ItemID">itemID of ANY of the topics in the thread</param> private void BindList(int ItemID) { // Obtain a list of discussion messages for the module and bind to datalist DiscussionDB discuss = new DiscussionDB(); ThreadList.DataSource = discuss.GetThreadMessages(ItemID, 'Y'); // 'Y' means include rootmessage ThreadList.DataBind(); }
// ********************************************************************* // PerformDataBindingForThreadList() // /// <summary> /// DataBinds the threadlist server control /// </summary> /// // ********************************************************************/ private void PerformDataBindingForThreadList() { ThreadCollection threads; // User specific data source ... note although we support paging, it's not being used. threads = Moderate.GetAllUnmoderatedThreads(ForumID, 25, 0, ForumUser.Username); // Do we have data to display? if (threads.Count == 0) { HttpContext.Current.Response.Redirect(Globals.UrlModeration); HttpContext.Current.Response.End(); } else { threadList.DataSource = threads; threadList.DataBind(); } }