Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 12: Working with Routes > Fixing the Master Page Tabs

Fixing the Master Page Tabs

Earlier in the chapter, we added a route for the Calculator.aspx class, and when we viewed the page using the routed URL, you may have noticed that the tabs that we added to the master page in Chapter 10 didn't work properly, as shown in Figure 12-6.

images

Figure 12-6. The URL and the tab highlighting don't match.

You can see that the URL is for the Calculator page but that the Events table is the one that is highlighted. The reason for this is that we used a map in the jQuery script to associate each tab with the pages that it represents, like this:

var pages = [
    ['Events', "/ListEvents.aspx", "/AddEvent.aspx", "UpdateOrDeleteEvent.aspx"],
    ['Performance', "/Performance.aspx"],
    ['Calculator', "/Calculator.aspx"]
];

var myPage = '<%=Request.Path%>';

var tabsDiv = $('#masterTabsDiv');

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint