I have a fairly simple implementation of an Ultrawebtab with six tabs with content panes. Under certain circumstances (running locally on XP with IE8 or on the server Win 7 with IE9) the tab click event will cause postback and clear out any navigating I have done in the content panes. I need to maintain the state of the various tabs as the user tabs through them and this postback causes the page to revert to original form. How can I prevent a postback when a tab click has been made? The Autopostback value is not set. Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Menu.aspx.vb" Inherits="Menu" StylesheetTheme="Office2007Blue" %><%@ Register Assembly="Infragistics2.WebUI.UltraWebTab.v11.1, Version=11.1.20111.2020, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.WebUI.UltraWebTab" TagPrefix="igtab" %><!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></title> <script type="text/javascript" id="igClientScript"> function UltraWebTab1_Click(oWebTab, oTab, oEvent) { document.getElementById('UltraWebTab1_cp').height = document.documentElement.offsetHeight - 30; return false; } window.onresize = function() { document.getElementById('UltraWebTab1_cp').height = document.documentElement.offsetHeight - 30 }; function UltraWebTab1_BeforeSelectedTabChange(oWebTab, oTab, oEvent) { if (oTab.getIndex() == 6) { if (confirm('Are you sure you want to exit?') == true) { window.location = 'logout.aspx'; } else { oEvent.cancel = true; } } } function UltraWebTab1_InitializeTabs(oWebTab) { document.getElementById('UltraWebTab1_cp').height = document.documentElement.offsetHeight - 30 } </script></head><body style="overflow: hidden;"> <form id="form1" runat="server"> <igtab:UltraWebTab ID="UltraWebTab1" runat="server" Width="100%" BarHeight="0"> <Tabs> <igtab:Tab Text="Admin" Tooltip="Admin" Key="0"> <ContentPane TargetUrl="/PrismManagement/Admin/AdminHome.aspx"> </ContentPane> </igtab:Tab> <igtab:Tab Text="Fishbowl" Tooltip="Fishbowl" Key="1"> <ContentPane TargetUrl="/PrismManagement/Fishbowl/FishbowlHome.aspx"> </ContentPane> </igtab:Tab> <igtab:Tab Text="Marketing" Tooltip="Marketing" Key="2"> <ContentPane TargetUrl="/PrismManagement/Marketing/MarketingHome.aspx"> </ContentPane> </igtab:Tab> <igtab:Tab Text="Member Services" Tooltip="Member Services" Key="3"> <ContentPane TargetUrl="/PrismManagement/MS/MSHome.aspx"> </ContentPane> </igtab:Tab> <igtab:Tab Text="Quality Assurance" Tooltip="Quality Assurance" Key="4"> <ContentPane TargetUrl="/PrismManagement/QA/QAHome.aspx"> </ContentPane> </igtab:Tab> <igtab:Tab Text="Report Finder" Tooltip="Report Finder" Key="5"> <ContentPane TargetUrl="/PrismManagement/Reports/ReportsWizard.aspx"> </ContentPane> </igtab:Tab> <igtab:Tab DefaultImage="./App_Themes/Office2007Blue/images/16x16/Logout.gif" ImageAlign="Middle" Tooltip="Logout" Key="6"> </igtab:Tab> </Tabs> <ClientSideEvents BeforeSelectedTabChange="UltraWebTab1_BeforeSelectedTabChange" Click="UltraWebTab1_Click" InitializeTabs="UltraWebTab1_InitializeTabs" /> <RoundedImage FillStyle="LeftMergedWithCenter" HoverImage="[ig_tab_winXP2.gif]" LeftSideWidth="7" NormalImage="[ig_tab_winXP3.gif]" RightSideWidth="6" SelectedImage="[ig_tab_winXP1.gif]" ShiftOfImages="2" /> <BorderDetails StyleBottom="Solid" StyleLeft="Solid" StyleRight="Solid" StyleTop="Solid" WidthBottom="0px" WidthLeft="0px" WidthRight="0px" WidthTop="0px" /> <SelectedTabStyle> <Padding Bottom="2px" /> </SelectedTabStyle> <DefaultTabStyle BackColor="#FEFCFD" Font-Names="Microsoft Sans Serif" Font-Size="8pt" ForeColor="Black" Height="22px"> <Padding Top="2px" /> </DefaultTabStyle> </igtab:UltraWebTab> </form></body></html>
Hi tdonley,
Thank you for posting in the community.
I have tested your scenario using version 11.1.20111.2020 but am so far unable to replicate the behavior under any version of IE or Firefox. Attached is my test sample for your consideration.
Please note that UltraWebTab is outdated and as of version 11.2 is no longer shipped with our products. You can find a detailed list of the retired controls and their respective replacements at:
http://blogs.infragistics.com/blogs/taz_abdeali/archive/2010/03/04/asp-net-product-changes.aspx
Please feel free to contact me if you are still experiencing any issues.
Thank you for your reply.
I have further investigated the matter using the code you have provided, however in order to be able to provide adequate feedback I would need a sample allowing me to reliably reproduce the matter. It may be also worth cancelling the tabchange on the BeforeSelectedTabChange event, and manually setting the selected tab, for instance:
function UltraWebTab1_BeforeSelectedTabChange(oWebTab, oTab, oEvent) { igtab_getTabById("UltraWebTab1").setSelectedIndex(oTab.getIndex()); oEvent.cancel = true; }
function UltraWebTab1_BeforeSelectedTabChange(oWebTab, oTab, oEvent) { igtab_getTabById("UltraWebTab1").setSelectedIndex(oTab.getIndex()); oEvent.cancel = true;
}
Feel free to contact me if you have any additional questions.
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
Ok, I’ve created a much simplified version with only two tabs and only one or two links per tab. The start page is menu.aspx. if you start the solution at the Quality Assurance tab and click on the Knowledge Base link, switch tabs to the Member Services tab, and then return to the QA tab, you will see the page has reloaded – Knowledge Base is gone.
I want Knowledge base to remain after tab changes. The only way around this as far as I can tell is to comment out the !DOCTYPE declaration, but that causes other trouble down the line.
Appreciate all the help,
Terrance
Hi Terrance,
Apologies for the delayed response.
Thank you for the sample. I have tested it under IE7/8/9 unfortunatelly so far the behavior is not manifested. It may be helpful to try placing all the referenced forms in the root project folder in order to see if that makes a difference in this scenario.
Hi Petar,
Thanks for the help. I did finally figure out the issue. The TargetUrls for each tab had the absolute path name rather than the relative path name. Who knew that could make such a difference?
Thank you for the followup. Glad that the matter has been resolved.
After digging in to this a bit more, I stumbled upon an old thread regarding WebTab and relative vs. absolute path names which turned out to be a matter of resetting the content url iframes' src. While WebTab is a different control, UltraWebTab also uses iframes for its content pages and you may be interested to see the information given at:
http://forums.infragistics.com/forums/t/63066.aspx
Please feel free to contact me if any further questions regarding this matter arise.