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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:39:15+00:00 2026-06-16T13:39:15+00:00

I have two aspx buttons on two separate Jquery tab panels. I’d like to

  • 0

I have two aspx buttons on two separate Jquery tab panels. I’d like to get the index of the active Jquery tab from the c# code behind so that the button within that tab becomes invisible. Any help will be greatly appreciated. ASP:

    <asp:HiddenField ID="hiddenFGetActiveTab" runat="server"/>
            <button ID="btnGetActiveTab"></button>
            <div id="tabs">
            <ul>        
            <li><a href="#tabs-1"></a></li>        
            <li><a href="#tabs-2"></a></li>
            </ul>
            <div id="tabs-1" style="border: 1px solid #E5E5E5;">
            <asp:UpdatePanel ID="updatePanelSearchCustomer" runat="server" UpdateMode="Conditional">
            <contentTemplate>
            <asp:Button ID="btnCustSearch" runat="server" Text="Search" ToolTip="Click to Search" OnClick="btnCustSearch_Click" />
            <asp:Button ID="btnAddCustomer" runat="server" Text="Add New" CommandName="insert" Visible="True" ToolTip="Add to Workbasket" OnClick="addToWorkBasket_Click" />
            <asp:GridView ID="gridCustSearch" OnRowCreated="gridCustLicSearch_RowCreated runat="server"></asp:GridView>
            </ContentTemplate>
            </asp:UpdatePanel>                 
            </div>
            <div id="tabs-2" style="border: 1px solid #E5E5E5;">
            <asp:Button ID="btnSearchLicense" runat="server" Text="Search" ToolTip="Click to Search" />
            <asp:Button ID="btnAddLicense" runat="server" Text="Add to Workbasket" Visible="False" ToolTip="Add to Workbasket" OnClick="btnAddLicense_Click" />
            <asp:UpdatePanel ID="updatePanelLicenseSearchFields" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
            <asp:GridView ID="gridLicSearch" runat="server" OnRowCreated="gridCustLicSearch_RowCreated"></asp:GridView>
            </ContentTemplate>
            </asp:UpdatePanel>
            </div>
            </div>

JQUERY:

                <link href="../css/jquery-ui-1.9.2.custom.css" rel="stylesheet" />
            <script src="../js/jquery-1.8.3.js"></script>
            <script src="../js/reflection.js"></script>
            <script src="../js/jquery-ui-1.9.2.custom.js"></script>
            <script type="text/javascript">


            $(document).ready(function () {


            $(function () {
            $("#tabs").tabs({ event: "click" });

            });

            $('#btnGetActiveTab').click(function (event) {
            event.preventDefault();
            varTab = $("#tabs").tabs("option", "selected");
            document.getElementById("<%= hiddenFGetActiveTab.ClientID %>").value = varTab;
            //$("#hiddenFGetActiveTab").val(varTab);
            //alert(varTab);
            alert(document.getElementById("<%= hiddenFGetActiveTab.ClientID %>").value);
            });

            function tabChanged(tabIndex) {
            varTab = $("#tabs").tabs("option", "selected");
            $("#hiddenFGetActiveTab").val(varTab);
            alert(document.getElementById("<%= hiddenFGetActiveTab.ClientID %>").value);
            }
            });

C# Code Behind:

                protected void gridCustLicSearch_RowCreated(object sender, GridViewRowEventArgs e)
            if (activeTabIndex == Tab-1)
            {
            //Make First button visible
            //do other stuff


            }
            else if (activeTab == Tab-2)
            {   
            //Make Second button visible
            //do other stuff

            }
  • 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-06-16T13:39:16+00:00Added an answer on June 16, 2026 at 1:39 pm

    Without seeing any of your code, I’d recommend using a <asp:HiddenField…
    Whenever you change a tab, set the hidden field to the index of the current tab.

    Then, in the codebehind you can see which tab is currently selected and enable/disable things as you wish…

    Short Example:
    In your aspx page add the following:

    <asp:HiddenField ID="hdnField" runat="server" />
    

    When you change tabs (in Javascript):

    function tabChanged(tabIndex)
    {
        $("#hdnField").val(tabIndex);
    }
    

    In CodeBehind:

    if (hdnField.Value == "1")
       ....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my website I have two files home.aspx and tab.aspx with code behind files
I have an aspx page with two buttons, one of the buttons has an
I have two pages that inherit from one master page, First.aspx or second.aspx. Navigation
I have some code where I need two separate required field validators for one
i have a aspx page with two buttons,close and submit button.when i press the
I have two aspx files for adding/deleting products to/from a sale. islemler.aspx SatisTedarik.aspx I
I have a form with two buttons in ASPX page. One to print with
I have two aspx page on my application. From the first one, lets say
In my aspx page, I have two radio buttons and a table.. if one
I have an .aspx page that contains two buttons one is btnCancel and another

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.