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/CMSAdminControls/Debug/ViewState.ascx.cs
using System;
using System.Data;

using CMS.EventLog;
using CMS.ExtendedControls;
using CMS.Helpers;
using CMS.UIControls;

public partial class CMSAdminControls_Debug_ViewState : ViewStateLog
{
    protected void Page_Load(object sender, EventArgs e)
    {
        EnableViewState = false;
        Visible = true;
    }


    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        Visible = false;

        try
        {
            if (Log != null)
            {
                // Get the log table
                DataTable dt = Log.LogTable;
                DataView dv = new DataView(dt);

                if (!DataHelper.DataSourceIsEmpty(dv))
                {
                    Visible = true;

                    gridStates.SetHeaders("", "ViewStateLog.ID", "ViewStateLog.IsDirty", "ViewStateLog.ViewState", "ViewStateLog.Size");

                    HeaderText = GetString("ViewStateLog.Info");

                    // Bind to the grid
                    if (DisplayOnlyDirty)
                    {
                        dv.RowFilter = "HasDirty = 1";
                    }

                    MaxSize = DataHelper.GetMaximumValue<int>(dv, "ViewStateSize");

                    gridStates.DataSource = dv;
                    gridStates.DataBind();
                }
            }
        }
        catch (Exception ex)
        {
            HeaderText = "Unable to acquire ViewState from the controls collection: " + ex.Message;
            Visible = true;

            EventLogProvider.LogException("Debug", "GETVIEWSTATE", ex);
        }
    }
}