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 8579791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:41:11+00:00 2026-06-11T20:41:11+00:00

I have a Page which has a 2 level web tab . The Content

  • 0

I have a Page which has a 2 level web tab . The Content tabs FIXED and VARIABLE in turn has a web tab. This web tab is loaded with a User control which has a gridview.
My problem is the textboxes in the Gridview are not cleared on going from one sub tab to next sub tab . I tried all possible methods :
1.Bind grid to null ( datasource and DatasoruceId )
2. grid dispose
3. grid columns clear
No luck !!!.. HELP!!!
Note : I am modifying the data in the textboxes from javascript.

<ig:Webtab id="wi" runat="server" width="938px" displaymode="Scrollable" meta:resourcekey="wtabInvestmentTypeResource1">
                                <ClientEvents SelectedIndexChanging="webTab_SelectedIndexChanging" />
                                <AutoPostBackFlags SelectedIndexChanged="On" />
                                <Tabs>
                                    <ig:ContentTabItem runat="server" Text="Variable Investment Type" meta:resourcekey="ContentTabItemResource1">
                                        <Template>
                                            <div class="clear vspacesmall hspacenarrow">
                                            </div>
                                            <ig:WebTab ID="wv" runat="server" Width="908px" DisplayMode="Scrollable" ClientIDMode="Static"
                                                meta:resourcekey="wtabVariableResource1">
                                                <ClientEvents SelectedIndexChanging="webTab_SelectedIndexChanging" />
                                                <AutoPostBackFlags SelectedIndexChanged="On" />     
                                            </ig:WebTab>
                                        </Template>
                                    </ig:ContentTabItem>
                                    <ig:ContentTabItem runat="server" Text="Fixed Investment Type" meta:resourcekey="ContentTabItemResource2">
                                        <Template>
                                            <div class="clear vspacesmall hspacenarrow">
                                            </div>
                                            <ig:WebTab ID="wf" runat="server" Width="908px" DisplayMode="Scrollable" class="tabs"
                                                meta:resourcekey="wtabFixedResource1">
                                                <ClientEvents SelectedIndexChanging="webTab_SelectedIndexChanging" />
                                                <AutoPostBackFlags SelectedIndexChanged="On" />
                                            </ig:WebTab>  

The web tab loads a user control which has the following gridview :

  <div class="clear vspacesmall gridtablearea scrollPanel-horizontal Contol-Max-Height">
                <asp:UpdatePanel ID="upBuyMultipleGetDiscount" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:GridView ID="gvInvestmentDetails" runat="server" OnRowDataBound="gvInvestmentDetails_RowDataBound"
                            TabIndex="5" AutoGenerateColumns="False" CssClass="gridtable scrollPanel-horizontal" Width="100%" meta:resourcekey="gvInvestmentDetails_DefaultResource1"
                           EnableViewState="true" ViewStateMode="Enabled" ShowFooter="true" OnRowCommand="gvInvestmentDetails_Row_Command">
                            <Columns>
                                <asp:BoundField DataField="InvestmentTypeId" />
                                <asp:BoundField DataField="CustomerCombinationId" />
                                <asp:BoundField DataField="ProductId" />

                                <asp:TemplateField HeaderText="Account"  ItemStyle-Width="100px" meta:resourcekey="Account">
                                    <ItemTemplate>
                                        <asp:Label ID="lblAccountName" runat="server" Text='<%# Eval("CustomerCombinationName") %>'></asp:Label>
                                    </ItemTemplate>                                
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Products" ItemStyle-Width="200px" meta:resourcekey="Products">
                                    <ItemTemplate>
                                        <asp:Label ID="lblProductName" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <asp:Label ID="lblTotal" CssClass="fRight boldText" ForeColor="#656565" runat="server" Text='TOTAL :' meta:resourcekey="lblTotal"></asp:Label>
                                    </FooterTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Phase Investment Amount"  meta:resourcekey="PhaseInvestmentAmount" >
                                    <ItemTemplate>
                                        <asp:Repeater ID="rptrPhases" runat="server" ClientIDMode="Static"  OnDataBinding="rptrPhases_OnDataBinding">
                                            <ItemTemplate>
                                                <div style="float: left; padding: 4px;">
                                                <table id="PhaseDetails">
                                                <tr>
                                                     <td>
                                                     <tr>
                                                    <asp:Label ID="lblPhaseID" runat="server" Text='<%# Eval("PhaseID") %>' Visible="False"></asp:Label>                                               
                                                    <asp:Label ID="lblPhaseName" Class="vspacesmall" runat="server" Text='<%# Eval("PhaseName") %>' ></asp:Label><br />
                                                    <asp:TextBox ID="txtPhaseAmount" runat="server" Text='<%# Eval("PhaseAmount", "{0:F2}") %>'  CssClass="tar"
                                                        ClientIDMode="Static" Width="80px" MaxLength="27" onpaste="return false;"  ViewStateMode="Enabled"
                                                        meta:resourcekey="txtPhaseAmount"></asp:TextBox>
                                                        </tr>
                                                        <tr>
                                                   <asp:Label ID="lblUsageAmount" runat="server" Visible="false" Text='<%# Eval("PhaseUpdateAmount", "{0:F2}") %>'></asp:Label> 
                                                    </tr>
                                                   </td>
                                                   </tr>
                                                   </table>
                                                </div>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <asp:Repeater ID="rptTotalAmount" runat="server" ClientIDMode="Static">
                                            <ItemTemplate>
                                             <div style="float: left; padding: 4px;">
                                             <table>
                                             <tr>
                                             <td>
                                                    <asp:TextBox ID="txtPhaseTotal" Text='<%# Eval("PhaseAmount", "{0:F2}") %>' Width="80px" CssClass="tar boldText" 
                                                    ForeColor="#656565" runat="server" ViewStateMode="Enabled" ClientIdMode="Static"  autocomplete="off"  ></asp:TextBox>
                                                    </td>
                                                    </tr>
                                                </table>
                                                </div>
                                            </ItemTemplate>

                                        </asp:Repeater>
                                    </FooterTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Roles" ItemStyle-Width="150px"   meta:resourcekey="Roles">
                                    <ItemTemplate>
                                        <asp:CheckBoxList ID="chckRoleList"  runat="server" DataTextField="RoleName"  
                                            DataValueField="RoleId" EnableViewState="true" ViewStateMode="Enabled"  onclick="checkBoxLstChanged(this.id,'chkSelectAll');SetIsChanged('1');">
                                        </asp:CheckBoxList>
                                        <asp:RadioButtonList ID="rdbRoleList" runat="server" DataTextField="RoleName" 
                                            DataValueField="RoleId" EnableViewState="true" ViewStateMode="Enabled">
                                        </asp:RadioButtonList>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <asp:CheckBox ID="chckSelectAll" runat="server" Text="Select All" onclick="setAllCheckBoxes('chckRoleList',this);SetIsChanged('1');" meta:resourcekey="chckSelectAll">
                                        </asp:CheckBox>
                                        <br>
                                        <asp:Button ID="btnRemove" runat="server" CssClass="btnStyle fLeft" Text="Remove" OnClientClick="return ValidateRemoveRoles('gvInvestmentDetails')"
                                             CommandName="RemoveRoles" CommandArgument='<%# Container.DataItemIndex %>'
                                              meta:resourcekey="btnRemove"  />
                                    </FooterTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="InvestmentAmount" meta:resourcekey="InvestmentAmount">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txtInvAmt" Width="80px" runat="server" Text='<%# Eval("InvestmentAmount","{0:F2}") %>'
                                           ClientIdMode="Static"  ViewStateMode="Enabled" CssClass="fRight tar  boldText" ></asp:TextBox >
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <asp:TextBox ID="txtTotalInvestment" ClientIdMode="Static" Width="80px" ViewStateMode="Enabled"  CssClass="fRight tar boldText "   ForeColor="#656565" runat="server" />
                                    </FooterTemplate>
                                </asp:TemplateField>
                                     <asp:BoundField DataField="RecordStatus"  />
                            </Columns>
                           <%-- <FooterStyle HorizontalAlign="Left" CssClass="boldText" ForeColor="#656565" />--%>
                        </asp:GridView>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>

The back end code for loading the USer control :

 private void LoadInvestmentDetails(int investmentTypeId, WebTab currentWebTab, int tabIndex)
        {
            Panel panel = GetPanelToBeLoaded(investmentTypeId);

            if (currentWebTab.Tabs[tabIndex].Controls.Count == 0)
            {

                    currentWebTab.Tabs[tabIndex].Controls.Add(panel);
                    budgetDetailsControl.Initialize(investmentTypeId);
                    budgetDetailsControl.InvestmentDetailsSaved += new ProjectInvestmentDetailsSavedEventHandler(BudgetDetailsControl_BudgetDetailsSaved);
                    PreviouslyLoadedTab = int.Parse(currentWebTab.Tabs[currentWebTab.SelectedIndex].UserControlUrl);


            }
      // other code 
         }



    private Panel GetPanelToBeLoaded(int investmentTypeId)
    {
        System.Web.UI.Control userControl = GetInvestmentDetailsUserControlUrl();
        Panel panel = new Panel();
        panel.Controls.Add(userControl);
        budgetDetailsControl = (IProjectInvestmentDetailsControl)userControl;
        budgetDetailsControl.InvestmentTypeID = investmentTypeId;
        return panel;
    }


        private System.Web.UI.Control GetInvestmentDetailsUserControlUrl()
        {
            return LoadControl(ProjectCommonKeys.URL_PROJECT_BUDGET_DETAILS);
        }

The Usercontrol implments the IprojectInvestmentDetails interface and the initalize function of the UC is called first for the binding etc

  • 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-11T20:41:12+00:00Added an answer on June 11, 2026 at 8:41 pm

    I figured out the problem. Each user control bound to the sub tab shud be given a unique Id..or else even if we bind new data the data from the earlier instance will persist.

    .

    private Panel GetPanelToBeLoaded(int investmentTypeId)
            {
                System.Web.UI.Control userControl = GetInvestmentDetailsUserControlUrl();
                **userControl.ID = investmentTypeId.ToString();**
                Panel panel = new Panel();
                panel.Controls.Add(userControl);
                projectInvestmentDetailsControl = (IProjectInvestmentDetailsControl)userControl;
                projectInvestmentDetailsControl.InvestmentTypeID = investmentTypeId;
                projectInvestmentDetailsControl.UserContext = userContext;
                projectInvestmentDetailsControl.PlanningWizardDataManager = PlanningWizardDataManager;
                projectInvestmentDetailsControl.PlanningServiceWrapper = PlanningServiceWrapper;
    
                return panel;
            }` 
    

    Thanks fr the help…

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

Sidebar

Related Questions

I have this page which has three peson searchs on them. Basically it's a
I have a page which has document.body.onload=function(){...} but this is suffering delays because the
This may sound a weird question, I have a page which has a link:
I'm confused as to how to accomplish this. I have a page which, has
I have a page which has an Html.DropDownList which takes in a viewdata parameter.
I have a page which has an Iframe. In that Iframe, there are six
I have a page which has several <canvas> elements. I am passing the canvas
I have a page which has a tree directory of people who work at
I have a page which has many event handlers. The code now reached 1000+
I have a page which has radio buttons and the selected value is taken

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.