private void BindData()
        {
            btnEmail.Attributes.Add( "onclick", "return CheckExceptions();" );

            if( ColorCodingOn )
            {
                chkColorCoding.Checked = true;
            }
            else
            {
                chkColorCoding.Checked = false;
            }

            if( ColorCodingLegendOn )
            {
                pnlLegend.Visible = true;
            }
            else
            {
                pnlLegend.Visible = false;
            }

            if( UserInfo.IsSuperUser )
            {
                btnClear.Visible = true;
                btnDelete.Visible = true;
                if( Page.IsPostBack && Request.QueryString["PortalID"] != null )
                {
                    ddlPortalid.Items.FindByValue( Request.QueryString["PortalID"] ).Selected = true;
                }
                intPortalID = int.Parse( ddlPortalid.SelectedItem.Value );
            }
            else
            {
                btnClear.Visible = false;
                btnDelete.Visible = false;
                intPortalID = PortalId;
            }

            int TotalRecords = 0;
            int PageSize = Convert.ToInt32( ddlRecordsPerPage.SelectedValue );

            if( Page.IsPostBack && Request.QueryString["LogTypeKey"] != null )
            {
                ddlLogType.Items.FindByValue( Request.QueryString["LogTypeKey"] ).Selected = true;
            }

            strLogTypeKey = ddlLogType.SelectedItem.Value;

            LogInfoArray objLog;
            int CurrentPage = PageIndex;
            if( CurrentPage > 0 )
            {
                CurrentPage--;
            }
            LogController objLogController = new LogController();
            if( intPortalID == - 1 && strLogTypeKey == "*" )
            {
                objLog = objLogController.GetLog( PageSize, CurrentPage, ref TotalRecords );
            }
            else if( intPortalID == - 1 && strLogTypeKey != "*" )
            {
                objLog = objLogController.GetLog( strLogTypeKey, PageSize, CurrentPage, ref TotalRecords );
            }
            else if( intPortalID != - 1 && strLogTypeKey == "*" )
            {
                objLog = objLogController.GetLog( intPortalID, PageSize, CurrentPage, ref TotalRecords );
            }
            else if( intPortalID != - 1 && strLogTypeKey != "*" )
            {
                objLog = objLogController.GetLog( intPortalID, strLogTypeKey, PageSize, CurrentPage, ref TotalRecords );
            }
            else
            {
                objLog = objLogController.GetLog( strLogTypeKey, PageSize, CurrentPage, ref TotalRecords );
            }

            if( objLog.Count > 0 )
            {
                dlLog.Visible = true;
                pnlSendExceptions.Visible = true;
                if( UserInfo.IsSuperUser )
                {
                    btnDelete.Visible = true;
                    btnClear.Visible = true;
                }
                pnlOptions.Visible = true;
                tblInstructions.Visible = true;
                dlLog.DataSource = objLog;
                dlLog.DataBind();

                InitializePaging( ctlPagingControlBottom, TotalRecords, PageSize );
            }
            else
            {
                UI.Skins.Skin.AddModuleMessage( this, Localization.GetString( "NoEntries", this.LocalResourceFile ), ModuleMessageType.YellowWarning );
                dlLog.Visible = false;
                pnlSendExceptions.Visible = false;
                btnDelete.Visible = false;
                btnClear.Visible = false;
                pnlLegend.Visible = false;
                tblInstructions.Visible = false;
            }
        }