Hrmm.
Well, I don't seem to be able to make things work at all, even in a stripped down very basic version. Here's what I've got:
A tabtest.aspx file which has:
Code:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<link rel="stylesheet" type="text/css" href="tabcontent.css" />
<script type="text/javascript" src="tabcontent.js">
/***********************************************
* Tab Content script v2.2- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="div_tabs" runat="server" style="position:relative; top:0px; border:2px solid grey; left:250px; width:80%;">
<ul id="tabs" class="shadetabs" runat="server">
<li><a href='#' rel='Div1' class='selected'>Tab 1</a></li>
<li><a href='#' rel='Div2'>Tab 2</a></li>
<li><a href='#' rel='Div3'>Tab 3</a></li>
<li><a href='#' rel='Div4'>Tab 4</a></li>
</ul>
<div style="border:1px solid gray; margin-bottom: 1em; padding: 10px">
<div id="Div1" class="tabcontent" runat="server">
Original Div 1
</div>
<div id="Div2" class="tabcontent" runat="server">
Original Div 2
</div>
<div id="Div3" class="tabcontent" runat="server">
Original Div 3
</div>
<div id="Div4" class="tabcontent" runat="server">
Original Div 4
</div>
</div>
</div>
<asp:Button ID="btn_changediv" runat="server" Text="Change Div 1 Content" />
<script type="text/javascript">
var objTabs=new ddtabcontent("tabs")
objTabs.setpersist(true)
objTabs.setselectedClassTarget("link") //"link" or "linkparent"
objTabs.init()
</script>
</form>
</body>
</html>
And then a tabtest.aspx.vb code behind file to handle the button click with this function:
Code:
Protected Sub btn_changediv_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_changediv.Click
Div1.InnerHtml = "Changed Div 1 Content"
End Sub
Clicking the button does, indeed, change the contents of Div1 as expected. However, the following two unexpected behaviours occur:
1) Clicking the button ALWAYS makes Tab3 active
2) The content of Div1 remains the changed content, never reverting to the original content with any click of that tab (or any other tab)
================
I'm still operating on the presumption that I've missed something here...any thoughts?
(Edit : I just tried it after stripping out the "div_tabs" div that was wrapped around everything...no change to the behaviour)
Bookmarks