/// <summary> /// Binds the data. /// </summary> private void BindData() { var list = ApplicationLogManager.GetLog(FilterDropDown.SelectedValue); list.Sort(new ApplicationLogComparer(SortField, SortAscending)); gvLog.DataSource = list; gvLog.DataBind(); }
/// <summary> /// Handles the Click event of the cmdClearLog control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> protected void cmdClearLog_Click(object sender, EventArgs e) { ApplicationLogManager.ClearLog(); if (System.Web.HttpContext.Current.User != null && System.Web.HttpContext.Current.User.Identity.IsAuthenticated) { MDC.Set("user", System.Web.HttpContext.Current.User.Identity.Name); } Log.Info("The error log was cleared."); BindData(); }