Hi i have a MasterPage (ASP.Net MVC) which contains a couple of loads for Jquery ui and under that a contentplaceholder for view specific scripts:
<script src="../../Scripts/jquery-1.3.2.js" type="text/javascript"></script>
<script src="../../Scripts/ui.core.js" type="text/javascript"></script>
<script src="../../Scripts/ui.tabs.js" type="text/javascript"></script>
<script src="../../Scripts/ui.accordion.js" type="text/javascript"></script>
<script src="../../Scripts/LeftNav.js" type="text/javascript"></script>
<asp:contentplaceholder id="Scripts" runat="server"></asp:contentplaceholder>
Now I made a view which contains this script
<asp:Content ID="Content2" ContentPlaceHolderID="Scripts" runat="server">
<script>
var $tabs = $('#tabs').tabs();$tabs.tabs('option', 'selected', <%= ViewData["tab"]%>) ;
location.href='#<%= ViewData["anchor"]%>';
</script>
</asp:Content>
tha value in tab is the tabindex which should be selected. the anchor is a anchor on the tabpage which should be selected.
My suggestion was that first all Master scripts load than the tabindex I saved in the ViewData will selected and than I jump to the anchor i wanted to.
But how could it else be... nothing happens.
The side loads and the tabs too. But not the tab in the ViewData propertie tab is selected. and than the anchor cant work annyway.
I tried following. I put a alert in the script above and if I do that the alert is thrown before the tabs are load. Why does he exectue this script before loading the ui.script`???????????