Demand:
The TabPanel class in the Tabcontainer container itself contains the Enabled property, or you can use the JavaScript method set_enabled (X) to set the Enabled property, if this property of a TabPanel is false , this tabpanel will not be shown in Tabcontainer, which is not quite the same as the "Enabled" property of a generic control, and I think it would be more appropriate to call it "visiable". As shown in the following illustration:
Sometimes this doesn't fit our needs, so in this case, we'll add the disabled feature so that the TabPanel control can turn gray without responding to client events.
1. Add service-side properties:
First we find the TabPanel.cs, which is the TabPanel class, in which you add the following attribute to represent whether the TabPanel is either "restore Enabled" or "dimmed disabled" status:
[DefaultValue("")]
[Category("Behavior")]
[ExtenderControlProperty]
[ClientPropertyName("disabled")]
public bool Disabled
{
get { return (bool)(ViewState["Disabled"] ?? false); }
set { ViewState["Disabled"] = value; }
}
internal bool Active
{
get { return _active; }
set { _active = value; }
}
In the attribute, we set Clientpropertyname to "disabled", which is to map this property to the _disabled attribute in the JavaScript behavior code and save the container in ViewState state.