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/CMS/CMSWebParts/General/usercontrol.ascx.cs
using System;
using System.Web.UI;

using CMS.EventLog;
using CMS.Helpers;
using CMS.PortalControls;
using CMS.ExtendedControls;

public partial class CMSWebParts_General_usercontrol : CMSAbstractWebPart
{
    private string mUserControlPath = "";

    /// <summary>
    /// Gets or sets the path of the user control.
    /// </summary>
    public string UserControlPath
    {
        get
        {
            return ValidationHelper.GetString(GetValue("UserControlPath"), mUserControlPath);
        }
        set
        {
            SetValue("UserControlPath", value);
            mUserControlPath = value;
        }
    }


    /// <summary>
    /// Content loaded event handler.
    /// </summary>
    public override void OnContentLoaded()
    {
        base.OnContentLoaded();
        SetupControl();
    }


    /// <summary>
    /// Initializes the control properties.
    /// </summary>
    protected void SetupControl()
    {
        if (StopProcessing)
        {
            // Do not process
        }
        else
        {
        }
    }


    /// <summary>
    /// Loads the user control.
    /// </summary>
    protected void LoadUserControl()
    {
        if (!string.IsNullOrEmpty(UserControlPath))
        {
            try
            {
                Control ctrl = Page.LoadUserControl(UserControlPath);
                ctrl.ID = "userControlElem";
                Controls.Add(ctrl);
            }
            catch (Exception ex)
            {
                lblError.Text = "[" + ID + "] " + GetString("WebPartUserControl.ErrorLoad") + ": " + ex.Message;
                lblError.ToolTip = EventLogProvider.GetExceptionLogMessage(ex);
                lblError.Visible = true;
            }
        }
    }


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

        // The control must load after OnInit to properly load its viewstate
       this.LoadUserControl();
    }
}