We have a Tab controlled rendered with CSS, using <li>.
Once rendered, we have this:
<div class="innertabs" id="tabbar">
<ul>
<li id="ctl00_ContentPlaceHolderMain_SIS_ICMS_IntranetWeb_Modules_Person_TabCasePlanYJ_CasePlan_TabInterventionsYJ_liOrders" class="" disabled="disabled">
<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','')">Orders</a>
</li>
<li id="ctl00_ContentPlaceHolderMain_SIS_ICMS_IntranetWeb_Modules_Person_TabCasePlanYJ_CasePlan_TabInterventionsYJ_liProgramActivityList" class="" disabled="disabled">
<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','')">Program/activity list</a>
</li>
<li id="ctl00_ContentPlaceHolderMain_SIS_ICMS_IntranetWeb_Modules_Person_TabCasePlanYJ_CasePlan_TabInterventionsYJ_liProgramActivityDetail" class="current">
<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','')">Program/activity details</a>
</li>
</ul>
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.
We are trying with this 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();
}
}
Is there a way to not make it clickable?
Ah, the list item is disabled instead of the child controls.
Try cycling through the child controls of liProgramActivityList, e.g. liProgramActivityList.Controls and disableing all those as well.