Troubleshooting Jquery Tabs and Styling Challenges

Utilizing jQuery tabs within a master page to open ASPX files when a tab heading is clicked. However, when the page is used as a link, it repeats the "header" part of the page (similar issue found here). Tried solutions without success. Can someone please provide assistance? Below is the code snippet from my masterpage:

<form id="form1" runat="server">
<div class="mainWrapper">
    <div class="wrapper">
        <div class="header">
            <a href="" class="logo"></a>
            <div class="topToolbar">
                <span>Welcome <a href="/" class="logOut">Log Out</a></span>
            </div>
        </div>
        <div class="container">
            <div id="tabs">
                <div class="tabsCenter">
                    <ul>
                        <li><a href="Myfirstpage.aspx">First</a></li>
                        <li><a href="SecondPage.aspx">Second</a></li>
                    </ul>

                </div>

                <div class="tabsBottom">
                </div>
            </div>
           <asp:ContentPlaceHolder ID="BodyContent" runat="server">
            </asp:ContentPlaceHolder>

        </div>
    </div>
    <div class="push">
    </div>
</div>
</form>

Edit:

Here is an updated version of the code :

<body>
    <form id="form1" runat="server">
    <div class="mainWrapper">
        <div class="wrapper">
            <div class="header">
                <a href="" class="logo"></a>
                <div class="topToolbar">
                    <span>Welcome <a href="/" class="logOut">Log Out</a></span>
                </div>
            </div>
            <div class="container">
                <div id="tabs">
                    <div class="tabsCenter">
                        <ul>
                            <li><a href="Track.aspx" runat="server" id="Tab1">Track</a></li>
                            <li><a href="Downloads.aspx" runat="server" id="Tab2" >Downloads</a></li>
                        <%--<li><a href="~/ClaimsLogin/ClaimsLogin">My Claims</a></li>
                            <li><a href="~/FAQ/FAQs">FAQ's</a></li>
                            <li><a href="~/MyProfile/ViewDetail">My Profile</a></li>
                            <li><a href="~/MyMessage/Message">Contact</a></li>--%>
                        </ul>
                        <div id="TabContent">
                        <asp:ContentPlaceHolder ID="BodyContent" runat="server">
                        </asp:ContentPlaceHolder>
                        </div>
                        <div id="TabContent2">
                        <asp:ContentPlaceHolder ID="BodyContent2" runat="server">
                        </asp:ContentPlaceHolder>
                        </div>
                    </div>
                    <div class="tabsBottom">
                    </div>
                </div>
            </div>
        </div>
        <div class="push">
        </div>
    </div>
    </form>
    <script type="text/javascript">
        $(document).ready(function () {
            $('.tabs').tabs({
                select: function (event, ui) {
                    var url = $.data(ui.tab, 'load.tabs');
                    location.href = url; // follow url
                    return false; // to disable default handling
                }
            });
        });
    </script>
</body>
</html>

Within the specific page, I am implementing the following:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Track.aspx.cs" Inherits="CustomerPortalV2.Track" MasterPageFile="~/Site.Master" %>



<asp:Content ID="Trackcontent" ContentPlaceHolderID="BodyContent" runat="server">
<div class="sideTabsWrapper">
Track page
</div>
</asp:Content>

Answer №1

According to a discussion on jquery tabs and asp.net master pages issue, there are two approaches you can take:

  1. If you prefer to load page contents via AJAX, make sure the content pages containing tab content do not include headers or tabs themselves. These should be plain pages (without using a Master page) that only contain the content to be displayed within the tab.

  2. The second approach involves following the actual URL when a tab is clicked (resulting in a new URL in the browser address bar). In this scenario, jquery tabs should not use AJAX to load tab contents. The original FAQ link referenced in the previous answer has been removed by Jquery UI, but you can refer to this related SO question for more information: Follow the links of the tab in jquery ui tab

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilize jQuery to export HTML or JSON data to an Excel spreadsheet

I am looking for a way to export json or html data to an excel sheet using only html and jquery, without involving any server code. I have found some fiddles that allow me to download the excel sheet successfully, but unfortunately, none of them work in In ...

The Semantic UI dropdown consistently fails to return a value

I am currently utilizing Semantic UI for an ASP.NET core project, and I am encountering an issue when trying to submit a form that contains a drop-down element. Despite my efforts, it always returns null, and the lack of proper documentation on this matter ...

What is the functioning model of asynchronous operations in ASP.NET web applications?

Understanding of Asynchronous vs Threading: Asynchronous programming differs from traditional threading. With Async, a single thread can handle multiple tasks concurrently. In the .Net framework, a thread pool assigns a new thread for each HTTP web reques ...

Blurring of text that occurs after resizing in CSS

When I use scale transform to zoom a div in HTML, the text inside becomes blurred. Is there a solution to make the text clear like the original? @keyframes scaleText { from { transform: scale(0.5, 0.5); } to { transform: scale(2, 2); } } ...

Can a single link have a customized background color and different properties set for when it is clicked on?

I need assistance with setting the background-color of this <ul> to none while also adjusting the link's background-color to black. Here is the CSS code I have used: a:link { background-color: black } And here is the HTML code snippet: <di ...

Ways to split JSON information into several pages?

I am currently facing an issue with my HTML code. It works perfectly fine for a small JSON file, displaying the data in an HTML table as expected. However, when I try to load a larger JSON file with around 15,000 rows of data, my page becomes unresponsiv ...

Tips for implementing personalized/modified CSS on Vuetify components?

Let's say I've included the v-text-field component from Vuetify in my Vue component as shown below: <v-text-field v-model="email" name="email" type="email" color="#90C143" label="Email"> Upon inspecting the element, it generates regular H ...

Establishing the footer within dompdf

This snippet demonstrates the specified behavior (jsfiddle). <!--Footer--> <div id="footer"> <span class="alignleft">$unique_ID</span> <span class="alignright"> Page <span class="pagenum"></span></span> < ...

Execute CSS within jQuery code only when the body class is present

I am attempting to use CSS (display: none;) within a script to hide elements from my menu only if a specific language is active. When the body class changes from one language to another, I want the script to check if the body class of a certain language ...

Customize selection options - AngularJS

I am working on an AngularJS form that includes a select option to create a restaurant entry in my database. <div id="name-group" class="form-group" ng-init="getClasses();"> <div class="select-wrapper"> <label for="location"> ...

Troubleshooting Multiline Textbox Problems in ASPxGridView

Currently, I am exploring the world of DevExpress Controls. After reviewing the ASPxGridView demonstration here, I noticed that the notes field utilizes a multiline TextBox. However, when I attempted to replicate the same code and design, I was unable to ...

What is the best way to center the image on a page?

How can I center an image on the screen with a caption? <div id="team-area"> <div class="container"> <div class="row"> <div class="col-12"> <h3 class="main-title">Our Team</h3> < ...

Is there a way to stop jQuery dragging functionality from causing the page to scroll unnecessarily

Whenever I drag an element from div1 to div2, the scrollbar in div1 keeps extending until I drop the element in div2. How can I prevent this extension without breaking the element being dragged? <div class="container-fluid"> <div class="row"> ...

Acquiring Images via Google Feed API

I am having trouble retrieving images from my WordPress feed () using the Google Feeds API. Despite my best efforts, I cannot seem to figure out why it is not working. Below is my current code, devoid of any attempts I have made to fetch images from the fe ...

How can I ensure the end of the list is clearly visible?

I'm experiencing an issue where the last element in my list is getting cut off. When I check the console logs, I can see that it's rendering properly. If I remove the 'position: fixed' style, I can see the element at the bottom of the l ...

How can I extract the value of an element from a response using Python?

import requests from bs4 import BeautifulSoup s = requests.Session() content = s.get('https://nucleus.niituniversity.in/Default.aspx').content soup = BeautifulSoup(content,"html5lib") print("viewState = " + str(soup.select_one("#__VIEWSTATE")["va ...

Highlight text when hovered over after a delay of X seconds

I have a question about implementing a feature where when a user hovers over any word in a text for two seconds, it will automatically become underlined. If the user clicks on the word, it will remain underlined until they click outside of the text or cl ...

Achieving consistent functionality with jQuery when transitioning to a new page within a Ruby on Rails application

As a novice in the world of Ruby on Rails and jQuery, I recently created a homepage using a template (available at ) as a starting point. The homepage consists of multiple pages connected through a navigation bar. While I have made modifications and addit ...

Unable to remove the "d-none" class using Bootstrap 4

Wondering if it's possible to remove the "d-none" class using JavaScript? This is the code snippet I currently have: <div id="progressBar" class="progress d-none"> <div class="progress-bar" role="progressbar" aria-valuenow="0" aria- ...

Unconventional arrangement of gaps for radio buttons

Hey there, I've been searching for solutions on various platforms but haven't found any luck so far. These are the questions I've looked into: Radio buttons and label to display in same line Documentation on <FIELDSE ...