Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
95
How do I keep aspx page in added webtab, when I click menu?
posted

Hi, I'm eve!!

I'm programming a website but I have some problems about using UltraWebTab.  The page is devided three frames, like top, left and body. Top and left of page show menus. then when I click menus, tab add dynamyclly and contents are shown in tabs.

How to add tab pages is...

First : open dafault.aspx -> open aspx page with tab

Second : Celick menu -> call javascript Tree_Menu_Show -> (dafault.aspx cs) page_load and hidbtnTab_Click

default.aspx

 <div id="contents" runat="server" class="DIV_Cont_Body">                                                                
  <igtab:UltraWebTab ID="uwTab" TabIndex="1" runat="server" CustomRules="padding:10px;"  Height="100%" Width="100%" BorderStyle="Solid" BorderWidth="1px" BackColor="#88B0E0" ThreeDEffect="false"  LoadAllTargetUrls="true" DummyTargetUrl=" " DisplayMode="Scrollable" Font-Names="Verdana" Font-Size="8pt">
     <ScrollButtons>                                            
         <PressedStyle BackColor="#E1EDFF"></PressedStyle>
          <HoverStyle BackColor="LightBlue"></HoverStyle>
          <Style Height="18px" Font-Size="8pt" Font-Names="Verdana"></Style>
     </ScrollButtons>
     <DefaultTabStyle Height="22px" Font-Size="8pt" Font-Names="Verdana" BackColor="#E1EDFF"></DefaultTabStyle>
       <RoundedImage SelectedImage="./Resources/COMMON/Images/tab_on.gif"
                NormalImage="./Resources/COMMON/Images/tab_off.gif" HoverImage="./Resources/COMMON/Images/tab_over.gif" FillStyle="LeftMergedWithCenter"></RoundedImage>
       <DefaultTabSeparatorStyle Font-Size="8pt" Font-names="Verdana"></DefaultTabSeparatorStyle>
       <SelectedTabStyle>
             <Padding Bottom="2px"></Padding>
        </SelectedTabStyle>
        </igtab:UltraWebTab>
         </div>

function Tree_Menu_Show(treeMenu) {

           var parameter = "./Default.aspx?ml1=" + treeMenu + "&ml2=01";
         
           $("whidtxtML1").value = treeMenu;       //instead of url ex)
           $("whidtxtML2").value = "01";
           $("whidtxtML3").value = "";
           <%=this.Page.ClientScript.GetPostBackEventReference(this.hidbtnTab, "") %>
       }

default.aspx cs

page_load

if (!IsPostBack)
        {
            if (this.uwTab.Tabs.Count +1 > 10)
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "tabcount", "alert(Can't open tabs')", true);
                return;
            }

            Infragistics.WebUI.UltraWebTab.Tab utab = new Tab();
           
            this.uwTab.Tabs.Add(utab);
           
            if (this.uwTab.Tabs.Count < 10)
            {
                utab.Text = whidtxtMENU_LEV4_NM.Value.ToString();
                utab.Style.Padding.Top = Unit.Pixel(4);
                utab.ContentPane.TargetUrl = temp;                                      <-- Call aspx page
                utab.Style.BackColor = System.Drawing.Color.White;               
                utab.ContentPane.Scrollable = Infragistics.WebUI.UltraWebTab.OverflowType.Auto;                
            }           
        }

protected void hidbtnTab_Click(object sender, EventArgs e)
    {
        //Same as above , adding tabs
    }

The problem is....

Main Page : default.aspx  

when I open default.aspx. a content of menu open with tab.  The content is another aspx page. Then I modify the content, clicking button, like Retrieve, Update, Delete...etc.

And I click another menu, then All aspx pages in added tabs reload..   <---That is problem!!!!

I don't want it not to reload. Just I want to maintain previous aspx pages in tabs, when I click any menus.

In addition....

Can I input control, like button or img to click ? actually I want to know how to close tabs.

when you use i.e 8, you can use tabs with 'x' button. Anyway I just want to close tab.

I searched lots of articles but I couldn't find what I want. Now I have no idea... T.T

If you know the solution. let me know how to do and please reply my question.  

Thank you.

Parents
No Data
Reply
  • 24497
    posted

    Hi Eve,

    If content of tabs (or their TargetUrls) is reloaded, then it means that there was a postback. I expect that TargetUrls will remain unchanged and should show same urls, but their content of course will be reloaded. If urls become different, then it means that application somewhere change TargetUrl values.

    To close tab on client you may use tabItem.setVisible(false).

    Below I wrote an example for you:

    <script type="text/javascript">
    function UltraWebTab1_Click(oWebTab, oTab, oEvent)
    {
     var src = oEvent.event.srcElement;
     if(!src)
      src = oEvent.event.target;
     if(!src){alert("no src");return;}
     if(src.nodeName != 'IMG' || src.src.indexOf("close.gif") < 0)
      return;
     //Note: a simple call like oTab.setVisible(false) can not be used because
     // a browser may lock element related to event and changed visibility will fail.
     // So, request to hide tab should be moved in another "thread":
     var command = "igtab_getTabById('" + oWebTab.ID + "').Tabs[" + oTab.index + "].setVisible(false)";
     window.setTimeout(command, 0);
    }
    </script>
        <igtab:UltraWebTab ID="UltraWebTab1" runat="server" Height="150px" Width="267px">
       <ClientSideEvents Click="UltraWebTab1_Click" />
       <Tabs>
        <igtab:Tab Text="New Tab<img src='./images/close.gif' />">
        </igtab:Tab>
        <igtab:Tab Text="New Tab<img src='./images/close.gif' />">
        </igtab:Tab>
        <igtab:Tab Text="New Tab<img src='./images/close.gif' />">
        </igtab:Tab>
       </Tabs>
        </igtab:UltraWebTab>

Children
No Data