Solved

Disappearing Jquery Tabs When Postback Occurs

Posted on 2011-03-21
8
724 Views
Last Modified: 2012-05-11
hi

I have a homePage.aspx with the tabs ,the content aspx pages are loading fine but when the postback occurs all the tabs are  disappearing only the aspx page is loading. I tried giving method="Post"  and action= "HomePage.aspx " but I'm still having the same issue ,Please help me with this I can post my code if anybody needs.   Thanks in advance
0
Comment
Question by:marugangareddy
  • 4
  • 4
8 Comments
 
LVL 51

Expert Comment

by:HainKurt
ID: 35183143
how do you load jquery tabs?
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 35183153
create a test page (with jquery tabs and method=post, aspx page)
or post a test link that demonstrates this behaviour
0
 

Author Comment

by:marugangareddy
ID: 35183305
thanks for u r reply

Here is my HomePage which has tabs


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Home.aspx.cs" Inherits="CheckingHeader.Home" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <link type="text/css" href="jquery-ui-1.8.9.custom.css" rel="stylesheet" />      
            <script type="text/javascript" src="jquery-1.4.4.min.js"></script>
            <script type="text/javascript" src="jquery-ui-1.8.9.custom.min.js"></script>
            
            <link type="text/css" href="StyleSheet.css" rel="stylesheet" />      
             <script type="text/javascript">
            $(document).ready(function()
             {
            $("#tabs").tabs();
 
                   
 
            });
        </script>

</head>
<body>
    <form id="form1" runat="server" >
    <div>
   
    <div id="tabs">

<ul>

     
         <li><a href="WebForm3.aspx"><span>Webform3</span></a></li>
       
</ul>  
</div>
   
   
    </div>
    </form>
</body>
</html>



My aspx page with action= Homepage.aspx




<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="CheckingHeader.WebForm3" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
   
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

        <link href ="StyleSheet.css" rel="stylesheet" type="text/css" />        
            <link type="text/css" href="jquery-ui-1.8.9.custom.css" rel="stylesheet" />      
            <script type="text/javascript" src="jquery-1.4.4.min.js"></script>
            <script type="text/javascript" src="jquery-ui-1.8.9.custom.min.js"></script>      
            
            <script type="text/javascript">
            // Accordion control
        $(document).ready(function()
                {
                    $( "#accordion1" ).accordion({ animated: 'bounceslide' }); // simple accordian with animation
                    $( "#accordion1" ).accordion( "option", "active", 0 );// 0 based index
                }
            );


</script>

</head>
<body>
    <form id="form1" runat="server" method="post" action="Home.aspx">
    <div>
    <table>
 <tr>
 <td class="LabelColumns"    ><asp:Label ID="Label23" Text="Description:" runat="server"  CssClass="controlMenuHeaderCell"></asp:Label></td >
 
 <td class="ControlColumns"><asp:TextBox ID="txtDescription" runat="server"  Width="350px" CssClass="Controlcss"></asp:TextBox></td>
 
 </tr>
 <tr>
 <td class="LabelColumns"   ><asp:Label ID="Label24" Text="Comments:" runat="server"  CssClass="controlMenuHeaderCell"></asp:Label></td >
 
 <td class="ControlColumns"><asp:TextBox ID="txtComment" runat="server" Width="350px" CssClass="Controlcss"></asp:TextBox></td>
 
 </tr>
 
 </table>

 <table>
 <tr>
 <td class="LabelColumns" ><asp:Button ID="cmdUpdate" Text="" runat="server" CssClass="SaveButtonStying" ToolTip="Save" /> </td>
 <td></td></tr>
 </table>

 

    </div>
    </form>
</body>
</html>




try to click on button and see the behaviour the Tabs are disappearing




0
 
LVL 51

Expert Comment

by:HainKurt
ID: 35183442
ok got it now...

you have home page, with a jQuery tab
This jQuery Tab is loading some aspx pages into some div elements...
when you post one of the page, it replaces whole window... which is what is expected behaviour...

not sure but you may try iFrames for each tab

<li><a href="WebForm3.aspx"><span>Webform3</span></a></li>

-->

<li><iFrame src="WebForm3.aspx">No Iframe</iFrame></li>
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 51

Assisted Solution

by:HainKurt
HainKurt earned 500 total points
ID: 35183504
or something like this:

<div id="tabs">
    <ul>
        <li><a href="#iFrame1"><span>One</span></a></li>
        <li><a href="#iFrame2"><span>Two</span></a></li>
        <li><a href="#iFrame3"><span>Three</span></a></li>
    </ul>

    <iFrame id="iFrame1" src="WebForm1.aspx">No Iframe</iFrame></li>
    <iFrame id="iFrame2" src="WebForm2.aspx">No Iframe</iFrame></li>
    <iFrame id="iFrame3" src="WebForm3.aspx">No Iframe</iFrame></li>
</tabs>
0
 

Accepted Solution

by:
marugangareddy earned 0 total points
ID: 35183624
Thanks for u r reply again

After i use iframes the screen  is like this

which is not really good is there any other solutions


Find the image please  Scrren after iframes used
0
 

Author Comment

by:marugangareddy
ID: 35191749
I am sorry HainKut

Now I use the Iframes in my HomePage.aspx, I have accordion controls in my sub pages. I use no scrolling in Iframes and gave style and width as 100% here when I  open my subpages the accordions are not expanding I tried giving different sizes but it didn't work for me can u help me please
0
 

Author Closing Comment

by:marugangareddy
ID: 35221281
Thank you Hainkurt for u r answer this was really helped me a lot
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now