Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 621891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:55:31+00:00 2026-05-13T18:55:31+00:00

I have a number of pages that include the same partial view which contains

  • 0

I have a number of pages that include the same partial view which contains a set of jquery tabs. The purpose of the partial view is to componentize a common set of tabs. The tabs are essentially links to the other pages. The urls for the tabs on the partial view are provided by the view model passed to the partial view.

The urls are of the form:

http://localhost:1999/Transactions/1/Item/

These urls match custom routes defined in the routing configuration.

My problem is that the tabs only display correctly for the first page displayed, selecting a tab takes me to the correct page, but the $(document).ready(function() does not execute and the ul for the tabs displays undecorated.

Typical page code is :

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Questern.ActiveOrderManagementSystem.Web.ViewModels.TransactionItemModel>" %>
<asp:Content ID="headerStuff" ContentPlaceHolderID="headerContent" runat="server">  
<script type='text/javascript'>
$(document).ready(function() {
    $("input[type=text]").tooltip();
});
</script>
</asp:Content>
<asp:Content ID="editTitle" ContentPlaceHolderID="TitleContent" runat="server">
Edit Transaction Item
</asp:Content>
<asp:Content ID="itemContent" ContentPlaceHolderID="MainContent" runat="server">
<h2>Edit Transaction Item</h2>
<% using (Html.BeginForm()) {%>
     <fieldset>
         <% Html.RenderPartial("TransactionSummaryInfo", Model.summaryModel); %> 
         <% Html.RenderPartial("TransactionTabs", Model.tabModel); %>
         <div class="container_16">
          <div class="grid_16 form_row_start">
              <div class="prefix_5 grid_2 ">  
                  <a id="btnSave" href="javascript:document.forms[0].submit()" class="fg-button fg-button-icon-left ui-state-default ui-corner-all"><span class="ui-icon ui-icon-disk">Save</span>Save</a>                        
              </div>
              <div class="grid_1">&nbsp;</div>
              <div class="grid_2 suffix_6"> 
                  <a id="btnCancel" class="fg-button fg-button-icon-left ui-state-default ui-corner-all"><span class="ui-icon ui-icon-cancel">Cancel</span>Cancel</a>  
              </div>
          </div>
      </div>    
    </fieldset>
<% } %>
</asp:Content>

Partial View code is:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Questern.ActiveOrderManagementSystem.Web.ViewModels.TransactionTabModel>" %>
<% if (false) { %>
  <link href="../../Content/forms.css" rel="stylesheet" type="text/css" media="screen" />
   <link href="../../Content/grid.css" rel="stylesheet" type="text/css" media="screen" />
   <script type="text/javascript" src="../../Scripts/roundCorners.js"></script>      
<% } %>
<script type='text/javascript'>
$(document).ready(function() {
    $('#tabs').tabs({
        select: function(event, ui) {
            var url = $.data(ui.tab, 'load.tabs');
            if (url) {
                location.href = url;
                return false;
            }
            return true;
        }
    });
});
</script>
<% using (Html.BeginForm())
   {%>
   <div id="tabs" >
    <ul> 
           <% int i = 0; foreach (TransactionComponent component in Enum.GetValues(typeof(TransactionComponent)))
              {
                  if (component == Model.selectedComponent)
                  {%>
                     <li class="ui-tabs-selected"><a href="#editbody"><%= Html.Encode(Model.tabNameList[i])%></a></li>
                <%} else
                  {%>
                      <li><a href="<%= Html.Encode(Model.tabLinkList[i]) %>"><%= Html.Encode(Model.tabNameList[i])%></a>
                <%}; 
                  i++;
              }%>
           </ul>
    </div>
    <%} %>

I got the jquery code for the tabs from the jquery docs http://docs.jquery.com/UI/Tabs in section *…follow a tab’s URL instead of loading its content via ajax

Apologies for the long post, I wanted to give as much context as possible.

Update: From running firebug I get the error “$ is not defined” and I can also see that the js files are not being found as the browser is trying to load them from

http://localhost:1999/Transactions/ instead of http://localhost:1999/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:55:31+00:00Added an answer on May 13, 2026 at 6:55 pm

    If you reference your scripts form the root of the site, the path will always be correct. Additionally, intellisense will be aware of the script.

    <script src="/Scripts/jquery.maskedinput-1.2.2.min.js" type="text/javascript"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Specifically, I have a number of pages in my Rails app that use the
I am indexing a set of websites which have a very large number of
Let's say I have an int that represents the number of rows in a
I have the following data that basically I only need a few bits of
We have a library that deals with many aspects of error reporting. I have
I currently have a C# Web Application Project with a multitude of pages as
Okay so I'm looping through the results that contains two question IDs and two
I've recently inherited a fairly large web site. The project is set up as
I am trying to write a C++ program that works like the game 24.
I have 2 databases and I need to link information between two big tables

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.