Hi,
I found a nice tabcontrol that has ajax enabled through the atlas dll. (location:http://geekswithblogs.net/steveclements/archive/2006/08/27/89438.aspx)
I wanted to convert it so it uses the new AJAX 1.0 RC. When I do so, I get an error on the javascript that updates the active button; can someone tell me what is going wrong?
The javascript error is: Object Expected and I get it linenumber 26 in the javascript below. It has something to do with the $( ) but it works great with the non enabled AJAX website using the atlas dll.
1<script type="text/javascript" language="javascript">2 // Var to store active tab...set to first tab on page load.3 var activetab;4 this.onload = function() {5 activetab = "tab1";6 }78 function tab_OnMouseOver(tab)9 {10 // Only use hover effect if tab is not active11 if(tab.className != "tabactive"){12 tab.className = "tabover";13 }14 return false;15 }16 function tab_OnMouseOut(tab)17 {18 if(tab.className != "tabactive") {19 tab.className = "tabs";20 }21 return false;22 }23 function tab_activate(tab)24 {25 // Set current active tab to normal26 $(activetab).className = "tabs";27 // Set tab class to active28 $(tab).className = "tabactive";29 // Set activetab var to this tab30 activetab = tab;3132 // return true so the control will still postback33 return true;34 }35</script>
If someone wants the two projects to look at it more closely, just let me know; or try it yourself! The atlas tabcontrol source can be located at site mentioned above.
This is the asp.net code of the button which calls the javascript (maybe it helps):
<td class="tabactive" id="tab1" onmouseover="return tab_OnMouseOver(this)" onmouseout="return tab_OnMouseOut(this);"> <asp:LinkButton CssClass="tabbtn" runat="server" ID="LinkButton1" Width="90" OnClientClick="return tab_activate('tab1');" CommandArgument="0"></asp:LinkButton></td>
The $() function was removed some time ago (I think at Beta 1). The new name for that function is $get().
Changing the $() to $get() resolved the problem! All works fine now.
Thanks alot Steve!
No comments:
Post a Comment