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

  • SEARCH
  • Home
  • 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 6140369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:06:35+00:00 2026-05-23T18:06:35+00:00

A modal dialog which contains three tabs (jquery ui tabs), displays those three tabs

  • 0

A modal dialog which contains three tabs (jquery ui tabs), displays those three tabs the first time only.

This is the view code that contains the tabs and is loaded inside the dialog box:

<%@Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

     <script type="text/javascript">
      $(document).ready(function () {
        $("#tabstest").tabs();

      });

    </script>

 </asp:Content>


<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">

   <h2>jQuery Tabs Example</h2>

  <div>
    <div id="tabstest">
    <ul>
        <li><a href="#tabs-1">Home</a></li>
        <li><a href="#tabs-2">Products</a></li>
        <li><a href="#tabs-3">Contact Us</a></li>
    </ul>
    <div id="tabs-1">


    <p> this is the home page </p>
        <%--<% Html.RenderPartial("GetHomeTab");  %>    --%>        
    </div>
    <div id="tabs-2">
     <p> this is the Products page </p>
      <%--  <% Html.RenderPartial("GetProductTab");  %> --%>        
    </div>
    <div id="tabs-3">

    <p> this is the contact us  page </p>
       <%-- <% Html.RenderPartial("GetContactUsTab");  %>   --%>        
    </div>
</div>    
</div>

</asp:Content>

when I close the dialog box and reopen it the tabs display as links, and the partial views that each of the three tabs are suppose to load upon click all get displayed in the same dilog box, BUT when I refresh my main page and click and open the dialog box (first time) the tabs work fine loading their partialivews respectively.

the Jquery for the dialog box is:

jQuery(document).ready(function () {
  $('.trigger').live('click', function (event) {
            var dialogBox = $('<div></div>');
            $(dialogBox).dialog({
                autoOpen: false,
                resizable: true,
                title: 'Test Modal Dialog',
                modal: true,
                width: 'auto',
                open: function (event, ui) {
                    $(this).load('<%=Url.Action("TabExample2","Controller")%>');

                },
               close: function(event,ui){

                                           }

                             });

            $(dialogBox).dialog('open');


        return false;
    });

Modal Dialog

any experience with such a problem before? I will appreciate your insight greatly.

Thanks

  • 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-23T18:06:36+00:00Added an answer on May 23, 2026 at 6:06 pm

    ok a couple things i’ve noticed here…

    var dialogBox = $('<div></div>');
    $(dialogBox).dialog({
    

    no need to have $() around dialogbox. it’s already a jquery object! This likely isn’t the problem, but it’s certainly not helping. 🙂

    next:
    try changing your close function to being this:

    close: function(event,ui){
        dialogBox.empty().dialog('destroy');    //basically what this does is empty it, and remove any dialog functionality from the div.
    }
    

    you might also want to move your tab initialization to the loading success handler. I find sometimes the document doesn’t fire as expected when using load.

     open: function (event, ui) {
               $(this).load('<%=Url.Action("TabExample2","Controller")%>', function(){
                   $("#tabstest").tabs();
               });
    
     },
    

    That should fix it up nicely 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an HTML link that opens a jQuery modal dialog which contains an
Firefox has this nice find-a-text-on-the-page dialog, which is non-modal and shows up at the
I'm trying to make a modal dialog in the least amount of jQuery code
I am using JQuery and Jquery UI to create a dialog box which contains
I am invoking a jquery modal dialog in which I have a save button.
I have a jquery-ui-dialog that contains a <form> which contains a <input type=file >
I got a jquery modal dialog which i load a jquery datatable inside. I
I have a modal dialog plugin written in jquery, that binds to the click
jQuery based modal dialog boxes are great as long as you do as much
In a jquery modal dialog, is there a way to select a button as

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.