Avatar of chrisy
chrisy
Flag for India asked on

jquery tab + asp.net

hi,

  Im using jquerytab in my web application.After saving information on first tab,i want to trigger second tab. Functionality is working fine for me. But  after postback of button ,jquery tab loses its design. Please help.  Following is my code
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
     <link href="css/StyleSheet.css" rel="stylesheet" type="text/css" />
      <link href="css/linkedin-blue.css" rel="stylesheet" type="text/css" />
       <script src="js/jquery-1.1.3.1.pack.js" type="text/javascript"></script>
        <script src="js/jquery.history_remote.pack.js" type="text/javascript"></script>
        <script src="js/jquery.tabs.pack.js" type="text/javascript"></script>
         <script type="text/javascript">
            $(function() {
 
                $('#container-1').tabs();
 $("#LinkButton1").click(function() {
                    $(this).parents('div').eq(1).triggerTab(2);
                    return false;
                });
                 $("#Button1").click(function() {
                     $('#container-1').triggerTab(2);
                    return true;
                });
               
            });
          
           
  
        </script>
         <link rel="stylesheet" href="css/jquery.tabs.css" type="text/css" media="print, projection, screen">
        <!-- Additional IE/Win specific style sheet (Conditional Comments) -->
        <!--[if lte IE 7]>
        <link rel="stylesheet" href="css/jquery.tabs-ie.css" type="text/css" media="projection, screen">
        <![endif]-->
</head>
<body  >
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    
       <asp:UpdatePanel ID="up1" runat="server" UpdateMode="Conditional">
       <ContentTemplate>
       
  <div id="container-1">
            <ul>
                <li><a href="#fragment-1"><span>Agreement</span></a></li>
                <li><a href="#fragment-2"><span>Primary Contact</span></a></li>
                <li><a href="#fragment-3"><span>Tabs are flexible again</span></a></li>
            </ul>
            <div id="fragment-1" style="color:Yellow">
                <p>First tab is active by default:<asp:LinkButton ID="LinkButton1" runat="server" 
                        ForeColor="White" onclick="LinkButton1_Click">Save &amp; Next</asp:LinkButton>
                </p>
                <pre><code>$(&#039;#container&#039;).tabs();</code></pre>   <asp:Button ID="Button1" 
                    runat="server" Text="Button" onclick="Button1_Click" />
            </div>
            <div id="fragment-2" style="color:Yellow">
                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
            </div>
            <div id="fragment-3" style="color:Yellow">
                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
                Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
            </div>
        </div>
 </ContentTemplate> 
  </asp:UpdatePanel>
    
    </div>
    <p>
     
    </p>
    </form>
</body>
</html>

Open in new window

ASP.NETjQuery

Avatar of undefined
Last Comment
chrisy

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Albert Van Halen

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
chrisy

ASKER
hi,

Thanks Albert.Now it's postback without lost its design.
But after click save button, next tab is not getting selected.

The follwing line is not working for me
   $('#container-1').tabs("select", $("#<%= hidTabID.ClientID %>").val());

I'm missing any reference?


   <script src="js/jquery-1.1.3.1.pack.js" type="text/javascript"></script>
        <script src="js/jquery.history_remote.pack.js" type="text/javascript"></script>
        <script src="js/jquery.tabs.pack.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/jquery.tabs.css" type="text/css" media="print, projection, screen">





chrisy

ASKER
I replaced    $('#container-1').tabs("select", $("#<%= hidTabID.ClientID %>").val());

with   $('#container-1').triggerTab(2); .It's working .Thanks

Your help has saved me hundreds of hours of internet surfing.
fblack61