[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1589
  • Last Modified:

Dev express tab active

I am using dev express Tab control.I am using three tabs each tab contains one user control

<dxtc:ASPxPageControl ID="_pageControl" runat="server"
    RenderMode="Lightweight" Width="100%"
    EnableCallBacks="True">
      <TabPages>

            <%-- user Control--%>
            <dxtc:TabPage Name="_userTabControl1" Text="Test1" >
                  <ContentCollection>
                        <dxc:ContentControl      ID="_userTabContentControl1" runat="server">
                 
                              <rmsc:RoleMappingSearchControl ID="_MappingSearchControl" runat="server" />
                 
                        </dxc:ContentControl>
                  </ContentCollection>
            </dxtc:TabPage>

                <%-- _userTabControl2--%>
        <dxtc:TabPage Name="_userTabControl2" Text="Test2" >
            <ContentCollection>
                <dxc:ContentControl ID="_userTabContentControl2" runat="server">
                   
                    <hysc:HyperLinkSearchControl ID="HyperLinkSearchControl" runat="server"/>
                   
                </dxc:ContentControl>
            </ContentCollection>
        </dxtc:TabPage>

            <%-- _userTabControl3--%>
            <dxtc:TabPage Name="_userTabControl3" Text="Test3"  >
                  <ContentCollection>
                        <dxc:ContentControl      ID="_userTabContentControl3" runat="server">
                              <dxc:ContentControl ID="_userTabContentControl3" runat="server">
                        </dxc:ContentControl>
                  </ContentCollection>
            </dxtc:TabPage>

 

      </TabPages>
</dxtc:ASPxPageControl>

In above three tabs all tabs user controls are executing.
My requirement is only selected tab or active user controls will work.for example if i click 1st tab,1st tab user control only execute.If i click on second tab,It should not execute first tab it will execute only second tab...
* Visibility wise no issues.Only clickable tabs are visible.
Can u please help me regarding this
0
mannevenu26
Asked:
mannevenu26
1 Solution
 
Sameer RaksheCommented:
If you are using Devexpress controls you must be aware of ASPXCallback Panel.
Keep Tab Pages and Call back panel separately.
at client side on Tab Page change event call callback panel.
Inside Call back panel load user controls respective to tab pages runtime.

Use Below code for reference. Also I'm attaching one sample Code. I haven't tasted this project but I had already applied this logic twice.

protected void ASPxCallbackPanel1_Callback(object source, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) {
        if (e.Parameter == "Show") {
            LoadUserControl();
            Session["Loaded"] = true;
        }
        else {
            UnloadUserControl();
            Session.Remove("Loaded");
        }

    }
    protected void LoadUserControl() {
        Control control = LoadControl("~/DataViewUserControl.ascx");
        control.ID = "uc";
        ASPxCallbackPanel1.Controls.Add(control);
    }
    protected void UnloadUserControl() {
        ASPxCallbackPanel1.Controls.Clear();
    }
dxCallbackPanelLoadUserControlTest.zip
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now