title: how to make the drop down list to be visible for certain user only in asp.net?
body: <p>i am trying to make the drop down list to be visible for certain user only. for example for user =1 i want the drop down list to be visible and for user = 2 i don't want the drop down list to be visible. </p>
  
  <p>i have tried this.  </p>
  
  <pre><code>if ((Convert.ToInt32(HttpContext.Current.Session["UserGroupId"]) == 1) || 
       Convert.ToInt32(HttpContext.Current.Session["UserGroupId"]) == 2 || 
       Convert.ToInt32(HttpContext.Current.Session["UserGroupId"]) == 4)
          {
              ddlSpecialist.Visible = true;
  
              ddlSpecialist.DataSource = Lundbeck.Web.BusinessLogic.FrequencyReport.GetFrequencyReportbySpecialistList();
              ddlSpecialist.DataTextField = "Repcode";
              ddlSpecialist.DataValueField = "Repcode";
              ddlSpecialist.DataBind();
              ddlSpecialist.Items.Insert(0, new ListItem("All", "0"));
              ddlSpecialist.SelectedValue = "0";
  
              if (Convert.ToInt32(HttpContext.Current.Session["UserGroupId"]) == 3)
              {
                  ddlSpecialist.Visible = false;
              }
          }
  </code></pre>
  
  <p>i dont get the result that i want when i do this. why is that?? thanks in advance. </p>