title: Disable a Tab in ASP.Net
body: <p>We have a Tab controlled rendered with CSS, using <code>&lt;li&gt;</code>.</p>
  
  <p>Once rendered, we have this:</p>
  
  <pre><code>&lt;div class="innertabs" id="tabbar"&gt;
  &lt;ul&gt;
      &lt;li id="ctl00_ContentPlaceHolderMain_SIS_ICMS_IntranetWeb_Modules_Person_TabCasePlanYJ_CasePlan_TabInterventionsYJ_liOrders" class="" disabled="disabled"&gt;
          &lt;a id="ctl00_ContentPlaceHolderMain_SIS_ICMS_IntranetWeb_Modules_Person_TabCasePlanYJ_CasePlan_TabInterventionsYJ_lnkOrders" href="javascript:__doPostBack('ctl00$ContentPlaceHolderMain$SIS_ICMS_IntranetWeb_Modules_Person_TabCasePlanYJ_CasePlan$TabInterventionsYJ$lnkOrders','')"&gt;Orders&lt;/a&gt;
      &lt;/li&gt;
      &lt;li id="ctl00_ContentPlaceHolderMain_SIS_ICMS_IntranetWeb_Modules_Person_TabCasePlanYJ_CasePlan_TabInterventionsYJ_liProgramActivityList" class="" disabled="disabled"&gt;
          &lt;a id="ctl00_ContentPlaceHolderMain_SIS_ICMS_IntranetWeb_Modules_Person_TabCasePlanYJ_CasePlan_TabInterventionsYJ_lnkProgramActivityList" href="javascript:__doPostBack('ctl00$ContentPlaceHolderMain$SIS_ICMS_IntranetWeb_Modules_Person_TabCasePlanYJ_CasePlan$TabInterventionsYJ$lnkProgramActivityList','')"&gt;Program/activity list&lt;/a&gt;
      &lt;/li&gt;
      &lt;li id="ctl00_ContentPlaceHolderMain_SIS_ICMS_IntranetWeb_Modules_Person_TabCasePlanYJ_CasePlan_TabInterventionsYJ_liProgramActivityDetail" class="current"&gt;
          &lt;a id="ctl00_ContentPlaceHolderMain_SIS_ICMS_IntranetWeb_Modules_Person_TabCasePlanYJ_CasePlan_TabInterventionsYJ_lnkProgramActivityDetail" href="javascript:__doPostBack('ctl00$ContentPlaceHolderMain$SIS_ICMS_IntranetWeb_Modules_Person_TabCasePlanYJ_CasePlan$TabInterventionsYJ$lnkProgramActivityDetail','')"&gt;Program/activity details&lt;/a&gt;
      &lt;/li&gt;
  
  
  
  &lt;/ul&gt;
  </code></pre>
  
  <p></p>
  
  <p>Problem is, when we set a tab to disabled, the text of the tab (on the actual tab bit that you click) goes disabled - but, still remains clickable.</p>
  
  <p>We are trying with this code:</p>
  
  <pre><code>private void TabCasePlanInterventionsProgramActivityDetails_OnCreateProgram()
      {
      //    ShowProgramActivityDetailPanel();
      //    TabCasePlanInterventionsProgramActivityList.Visible = false;
      //    TabCasePlanInterventionsProgramActivityDetail.Visible = true;
      //    liProgramActivityList.Disabled = true;
      //    liOrders.Disabled = true;
  
          ShowProgramActivityDetailPanel();
          TabCasePlanInterventionsProgramActivityList.Visible = false;
          TabCasePlanInterventionsProgramActivityDetail.Visible = true;
          TabCasePlanInterventionsOrders.Visible = false;
          //TabCasePlanInterventionsProgramActivityList.PopulateForm();
  
          liProgramActivityList.Attributes.Add("class", "");
          liProgramActivityDetail.Attributes.Add("class", "current");
          liOrders.Attributes.Add("class", "");
          liProgramActivityList.Disabled = true;
          liOrders.Disabled = true;
  
  
          if (CurrentAssessment!= null)
          {
              TabCasePlanInterventionsProgramActivityDetail.CurrentAssessment = CurrentAssessment; 
          }
  
          TabCasePlanInterventionsProgramActivityDetail.ChangeToCreateMode();   
  
          if (CurrentCasePlan!= null)
          {
              TabCasePlanInterventionsProgramActivityDetail.CurrentCasePlan = CurrentCasePlan;
              TabCasePlanInterventionsProgramActivityDetail.ChangeToCreateMode();   
          }
      }
  </code></pre>
  
  <p>Is there a way to not make it clickable?</p>