Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8224035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:54:58+00:00 2026-06-07T14:54:58+00:00

I have a sysadmin tab and when clicked generates a lot of ajax tabpanel

  • 0

I have a sysadmin tab and when clicked generates a lot of ajax tabpanel which is dynamic and database driven …

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<br />
<ajaxToolkit:TabContainer ID="TabContainer1" runat="server" Width="100%" ActiveTabIndex="0"
    CssClass="ajax__tab_header">
    <ajaxToolkit:TabPanel ID="TPAdjCal" Width="100%" runat="server">
        <HeaderTemplate>
            <img runat="server" id="imgAdjCalendarleft" visible="false" alt="" src="../images/Tabs/GreenLeftBottom.gif" /><asp:Button
                ID="imgAdjCalendar" BorderStyle="none" Text="" CssClass="MainTabs"
                runat="server"></asp:Button><img alt="" src="../images/Tabs/GreenRightBottom.gif"
                    runat="server" id="imgAdjCalendarright" visible="false" />
        </HeaderTemplate>
        <ContentTemplate>
            <table class="HeaderCaption" id="Table1" cellspacing="0" cellpadding="3" width="100%"
                border="0" runat="server">
                <tr class="PagerRow">
                    <td>
                        <asp:Label ID="HeaderLabel1" runat="server" Text="Label"></asp:Label>
                        <asp:Label ID="FunctionCode1" runat="server" Text="" Visible="false"></asp:Label>
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </ajaxToolkit:TabPanel>
    <ajaxToolkit:TabPanel ID="TabContainer2" Width="100%" runat="server">
        <HeaderTemplate>
            <img runat="server" id="imgPoliceReportsleft" visible="false" alt="" src="../images/Tabs/GreenLeftBottom.gif" /><asp:Button
                ID="imgPoliceReports" BorderStyle="none" Text="" CssClass="MainTabs"
                runat="server"></asp:Button><img alt="" src="../images/Tabs/GreenRightBottom.gif"
                    runat="server" id="imgPoliceReportsright" visible="false" />
        </HeaderTemplate>
        <ContentTemplate>
            <table class="HeaderCaption" id="Table2" cellspacing="0" cellpadding="3" width="100%"
                border="0" runat="server">
                <tr class="PagerRow">
                    <td>
                        <asp:Label ID="HeaderLabel2" runat="server" Text="Label"></asp:Label>
                        <asp:Label ID="FunctionCode2" runat="server" Text="" Visible="false"></asp:Label>
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </ajaxToolkit:TabPanel>
 </ajaxToolkit:TabContainer>

CODE BEHIND: when sysadmin tab is clicked i call a loadmanager method which loads the tabs.. sample below

      protected void LoadManagerTabs(bool runFirstLoad)
        {
       if (Session["UserSystemTabs"] == null)
          {
     postMessage("You do not have access to any system functions", Constants.ERROR_MSG,false);
        return;
    }

    string[,] functions = Session["UserSystemTabs"] as string[,];

    functions.GetLength(0);
    if (functions.GetLength(0) > 0)
    {
        string funccode = functions[0, 0];
        if (funccode.Length > 0)
        {
            if (isHaveAccess(funccode))
            {
                string pagename = DBUtils.getFuncUrlByCode(funccode);
                try
                {
                    eClaim.Controls.Tables.DataTables contr = null;
                    contr = (eClaim.Controls.Tables.DataTables)LoadControl("~/" + pagename + ".ascx");
                    contr.Key = "";
                    contr.runPageLoad = runFirstLoad;

                    contr.FuncCode = funccode;
                    TPAdjCal.Controls.Add(contr);
                    TPAdjCal.Visible = true;
                    imgAdjCalendar.Text = functions[0, 1];
                    HeaderLabel1.Text = functions[0, 1];
                    FunctionCode1.Text = functions[0, 0];
                    //imgAdjCalendar.Visible = true;
                }
                catch
                {
                    DataTablesV2 contr = null;
                    contr = (DataTablesV2)LoadControl("~/" + pagename + ".ascx");
                    contr.Key = "";
                    //contr.runPageLoad = runFirstLoad;

                    if (ShouldRunPageLoad(funccode) && TabContainer1.ActiveTabIndex.Equals(0))
                    {
                        contr.runPageLoad = true;
                    }
                    else
                    {
                        contr.runPageLoad = false;
                    }

                    contr.FuncCode = funccode;
                    TPAdjCal.Controls.Add(contr);
                    TPAdjCal.Visible = true;
                    imgAdjCalendar.Text = functions[0, 1];
                    HeaderLabel1.Text = functions[0, 1];
                    FunctionCode1.Text = functions[0, 0];
                    //imgAdjCalendar.Visible = true;
                }

                if (TabContainer1.ActiveTabIndex.Equals(0))
                {
                    imgAdjCalendar.CssClass = "MainTabsSelected";
                    imgAdjCalendarleft.Src = "../images/Tabs/LightGreenLeftBottom.gif";
                    imgAdjCalendarright.Src = "../images/Tabs/LightGreenRightBottom.gif";
                }
                else
                {
                    imgAdjCalendar.CssClass = "MainTabs";
                    imgAdjCalendarleft.Src = "../images/Tabs/GreenLeftBottom.gif";
                    imgAdjCalendarright.Src = "../images/Tabs/GreenRightBottom.gif";
                }
            }
            else
            {
                TPAdjCal.Visible = true;
                imgAdjCalendar.Visible = false;
                imgAdjCalendarleft.Visible = false;
                imgAdjCalendarright.Visible = false;
            }
        }
    }
    else
    {
        TPAdjCal.Visible = true;
        imgAdjCalendar.Visible = false;
        imgAdjCalendarleft.Visible = false;
        imgAdjCalendarright.Visible = false;
        imgTabScrollright.Visible = false;
        btnTabScroll.Visible = false;
        imgTabScrollleft.Visible = false;
    }

    if (functions.GetLength(0) > 1)
    {
        string funccode = functions[1, 0];
        if (funccode.Length > 0)
        {
            if (isHaveAccess(funccode))
            {
                string pagename = DBUtils.getFuncUrlByCode(funccode);
                try
                {
                    eClaim.Controls.Tables.DataTables contr = null;
                    contr = (eClaim.Controls.Tables.DataTables)LoadControl("~/" + pagename + ".ascx");
                    contr.Key = "";
                    contr.runPageLoad = runFirstLoad;
                    contr.FuncCode = funccode;
                    TabContainer2.Controls.Add(contr);
                    TabContainer2.Visible = true;
                    imgPoliceReports.Text = functions[1, 1];
                    HeaderLabel2.Text = functions[1, 1];
                    FunctionCode2.Text = functions[1, 0];
                    //imgPoliceReports.Visible = true;
                }
                catch
                {
                    DataTablesV2 contr = null;
                    contr = (DataTablesV2)LoadControl("~/" + pagename + ".ascx");
                    contr.Key = "";
                    contr.runPageLoad = runFirstLoad;
                    contr.FuncCode = funccode;
                    TabContainer2.Controls.Add(contr);
                    TabContainer2.Visible = true;
                    imgPoliceReports.Text = functions[1, 1];
                    HeaderLabel2.Text = functions[1, 1];
                    FunctionCode2.Text = functions[1, 0];
                    //imgPoliceReports.Visible = true;
                }

                if (TabContainer1.ActiveTabIndex.Equals(1))
                {
                    imgPoliceReports.CssClass = "MainTabsSelected";
                    imgPoliceReportsleft.Src = "../images/Tabs/LightGreenLeftBottom.gif";
                    imgPoliceReportsright.Src = "../images/Tabs/LightGreenRightBottom.gif";
                }
                else
                {
                    imgPoliceReports.CssClass = "MainTabs";
                    imgPoliceReportsleft.Src = "../images/Tabs/GreenLeftBottom.gif";
                    imgPoliceReportsright.Src = "../images/Tabs/GreenRightBottom.gif";
                }
            }
            else
            {
                TabContainer2.Visible = true;
                imgPoliceReports.Visible = false;
                imgPoliceReportsleft.Visible = false;
                imgPoliceReportsright.Visible = false;
            }
        }
    }
    else
    {
        TabContainer2.Visible = true;
        imgPoliceReports.Visible = false;
        imgPoliceReportsleft.Visible = false;
        imgPoliceReportsright.Visible = false;
        imgTabScrollright.Visible = false;
        btnTabScroll.Visible = false;
         imgTabScrollleft.Visible = false;
    }

I am trying to implement lazy loading so when sysadmin tab is click only the first tab data will load and not all the tabs. I have been searching but i dont find anything to help me with my situation… any help will be much appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:55:02+00:00Added an answer on June 7, 2026 at 2:55 pm

    the problem is what you want doesn’t work with webforms. at least not like this. you may want to try using a multiview control. And, possibly, adding views to the multiview dynamically, but they all need to be created with each request for the views to function properly in webforms.

    I would also try to encapsulate the UI details into webusercontrols (ascx) and load the user controls dynamically. this way you can keep most of the layout in design time, rather than runtime.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have written this little class, which generates a UUID every time an object of
Previously for all our asp.net applications we have been using a sysadmin user within
We currently have a Database Project, which we wrote a WIX Installer for to
I have two SQL Servers on which I am a sysadmin. One is a
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have deployed numerous report parts which reference the same view however one of them
We have an application which uses an instance of Sql Server locally for its
I have created a test user that has sysadmin right in SQL Server 2005
I have a directory table in a MySQL database that contains user ID's, user
I'm using Jira and have been told by the sysadmin that GreenHopper has been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.