Conditional visibility of combo box
<p>I am working on a page that checks whether the ROLE_ID = 3 or not and if it is 3 then </p>

<pre><code>        if ((Int32.Parse(Session["RoleID"].ToString()) == 3))

        {

            cmbempList.Visible = false;

        }
</code></pre>

<p>Now I want to check that the user with ROLE_ID = 3 is a mentor or not and if he is a mentor then the cmbempList would be visible to him.</p>

<pre><code>  public bool CheckMentorAccess()

    {

        bool blnAllow = false;

        try
        {
            string strSelectMentorQuery = "SELECT COUNT(DISTINCT MLL.LED_ID) FROM M_USER_DETAILS MUD INNER JOIN M_LEADERLED MLL "
                + "ON MLL.LED_ID = MUD.PK_ID WHERE MLL.LEADER_ID = '" + Session["UserID"].ToString()
                + "' AND MUD.ACTIVE = 1 AND MLL.START_DATE &lt;= Getdate() AND"
                + " MLL.END_DATE &gt; Getdate()";

            int intNoOfMembers = Convert.ToInt32(cSQLHelper.myExecuteScalar(strSelectMentorQuery));

            if (intNoOfMembers &gt; 0)
            {
                blnAllow = true;
            }

        }
        catch (Exception ex)
        {
            ExceptionLogger.LogException(ex);
            blnAllow = false;
        }

        // Return the value
        return blnAllow;
    }
</code></pre>

<p>if this function returns true, and the ROLE_ID = 3 then the cmbempList would be visible to him.</p>

<p>Can anybody help me??</p>
