HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/RMourik/bassol.nl/wwwroot/CMSModules/System/Debug/System_DebugViewState.aspx.cs
using System;
using System.Data;

using CMS.Controls;
using CMS.Helpers;
using CMS.UIControls;

public partial class CMSModules_System_Debug_System_DebugViewState : CMSDebugPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        btnClear.Text = GetString("Debug.ClearLog");

        ReloadData();
    }


    protected void ReloadData()
    {
        if (!ViewStateDebug.Settings.Enabled)
        {
            ShowWarning(GetString("DebugViewState.NotConfigured"));
        }
        else
        {
            plcLogs.Controls.Clear();

            var logs = ViewStateDebug.Settings.LastLogs;

            for (int i = logs.Count - 1; i >= 0; i--)
            {
                try
                {
                    // Get the log
                    var log = logs[i];
                    if (log != null)
                    {
                        // Load the table
                        DataTable dt = log.LogTable;
                        if (!DataHelper.DataSourceIsEmpty(dt))
                        {
                            // Load the control
                            ViewStateLog logCtrl = (ViewStateLog)LoadLogControl(log, "~/CMSAdminControls/Debug/ViewState.ascx", i);

                            logCtrl.DisplayTotalSize = false;
                            logCtrl.DisplayOnlyDirty = chkOnlyDirty.Checked;

                            // Add to the output
                            plcLogs.Controls.Add(logCtrl);
                        }
                    }
                }
                catch
                {
                }
            }
        }
    }


    protected void btnClear_Click(object sender, EventArgs e)
    {
        ViewStateDebug.Settings.LastLogs.Clear();
        ReloadData();
    }
}