Currently, I am utilizing the ASP.NET AJAX Tab Container with two tab panels. Each tab panel contains a div tag, and by default, my ActiveTabIndex is set to "0."
Now, I am trying to apply CSS properties to the div tags using JavaScript without causing any post back events. However, I am facing an issue where the CSS property for the first tab panel is not being applied when using the following script. This script works when executed in the code-behind for selected index change, but it results in a postback.
The script I am currently using and need assistance with:
<script type="text/javascript" language="javascript">
function PanelClick(Sender, e) {
debugger;
var CurrentTab = $find('<%=Tab1.ClientID%>');
if( Sender._activeTabIndex==0) {
debugger
document.getElementById('<%=mycustomscroll2.ClientID%>').className = '';
document.getElementById('<%=mycustomscroll2.ClientID%>').Enabled = false;
document.getElementById('<%=mycustomscroll.ClientID%>').className = 'flexcroll';
}
if (Sender._activeTabIndex == 1) {
debugger
document.getElementById('<%=mycustomscroll.ClientID%>').className = '';
document.getElementById('<%=mycustomscroll.ClientID%>').Enabled= false ;
document.getElementById('<%=mycustomscroll2.ClientID%>').className = 'flexcroll';
}
}
</script>
I am seeking guidance on how to enable CSS properties for the div elements within the tab panel strictly through JavaScript. Any help or suggestions would be greatly appreciated. Thank you.