I know that I'm probably late to answer this question, but hopefully I can offer some help to someone who worked like I was on TabPanels.
Add OnClientActiveTabChanged = "showMap" in ajaxToolkit: TabContainer . My function is obviously called showMap (I had to hide and show the Google Street Map because TabContainer twists it all. So I had to move the Google Street map outside the container and then "fake" it back into the container).
<ajaxToolkit:TabContainer runat="server" ID="tabs" OnClientActiveTabChanged="showMap"> <ajaxToolkit:TabPanel runat="server" ID="pnlZones" HeaderText="Delivery Zones"> <ContentTemplate> ... </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer>
Then create javascript:
<script type="text/javascript"> function showMap() { var tabID = $('.ajax__tab_active').attr('id'); if (tabID.indexOf('pnlZone') > 0) { $('#mapHider').css('height', '600px'); } else { $('#mapHider').css('height', '0'); } } </script>
Then we can find the active tab with the class .ajax__tab active , and this is what TabContainer will set for the active class. Run the identifier ( .attr ('id') ) using jQuery ... And now we see which tab we are now.
To do this, I change the class height from 0 to 600 pixels. With overflow set to hidden, it makes the map appear to be on the page and only in this container, but it is not.
Hope this helps! Good luck.
source share