Finden Sie heraus, von C# - Code-behind-was ist der active Jquery tab-index

Habe ich zwei aspx-Tasten auf zwei verschiedenen Jquery-tab-panels. Ich würde gerne den index des aktiven Jquery Registerkarte aus der c# - code-behind-so dass der button in den tab unsichtbar wird. Jede Hilfe wird sehr geschätzt. 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

            }
  • Alle code-Beispiele?
Schreibe einen Kommentar