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 6693315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:58:07+00:00 2026-05-26T05:58:07+00:00

I have a aspx page which has three tabs. When I click a button

  • 0

I have a aspx page which has three tabs. When I click a button in tab3, a postback will occur and it will bring me back to the tab1. How do I stay in the tab3?
Following is my aspx page. Also I have noticed we have a javascript to set the active tab to tab1. Can anyone tell me how to modify it so that it will set the selected tab as the active tab during a postback?

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

        //When page loads...
        $(".tab_content").hide(); //Hide all content
        $("ul.tabs li:first").addClass("active").show(); //Activate first tab
        $(".tab_content:first").show(); //Show first tab content

        //On Click Event
        $("ul.tabs li").click(function() {

            $("ul.tabs li").removeClass("active"); //Remove any "active" class
            $(this).addClass("active"); //Add "active" class to selected tab
            $(".tab_content").hide(); //Hide all tab content

            var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
            $(activeTab).fadeIn(); //Fade in the active ID content
            return false;
        });

    });

<div id="content">    
<ul class="tabs">
<li><a href="#tab1">Edit</a></li> 
<li><a href="#tab2">History</a></li> 
<li><a href="#attachmentcontent">Attachments</a></li> 
</ul>


<div class="tab_container"> 

<div id="tab1" class="tab_content">

…

  • 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-26T05:58:08+00:00Added an answer on May 26, 2026 at 5:58 am

    What you’re referring to is maintaining state, common approaches would be store a variable in the session or viewstate indicating what is the ‘selected’ tab. Then on page load read that back and apply it to your page in the appropriate location.

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

Sidebar

Related Questions

I have an aspx page that has a @Page directive which points to a
I have an aspx page on which I have 2 static jquery tabs.Upon clicking
I have a < div > in my aspx page which has some notification
I have small page which has label, DropDownList and a submit button. <div> <asp:label
I have the .aspx page which is already developed in VS 2008 with its
In my .aspx page which derives from a master page I have a contact
I have a panel on an aspx page which contains an UpdatePanel. This panel
I have an ASPX page (On server A) which is invoked using NTLM credentials.
I have Default.aspx page, which inherits from BasePage.cs, which inherits from System.Web.UI.Page. BasePage is
I have one aspx page with some controls. Also i have one DIV which

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.