locked
Can't set value to some of the controls inside tabpanel of tabcontainer RRS feed

  • Question

  • User-10248131 posted

    Hi guys,

    I have a tabpanel inside a tabcontainer, within the tabpanel I have a few controls including textbox (single line and multi-line), checkbox.

    I am able to load data into some of the controls but there are two textbox (one single line and one multi-line) failed to load data.

    My original code is quite simple:

    Me.txtLARReason.Text = dt.Rows(0)("ReviewDetail")

    There is no error for it but txtLARReason shows blank.

    I am thinking maybe inside a tabcontainer is causing the problem (although other textboxes have no issue), I tried the following:

                Dim txtLARReason1 As TextBox
                txtLARReason1 = CType(TabContainer1.FindControl("tpLAR").FindControl("txtLARReason"), TextBox)
                txtLARReason1.Text = dt.Rows(0)("ReviewDetail")

    And nothing changes.

    The working control is:

    Me.txtLARReviewer.Text = dt.Rows(0)("Reviewer")

    txtLARReviewer and txtLARReason are within the same tabpanel

    The frontend code is:

    <cc1:TabContainer runat="server"  AutoPostBack="true" OnClientActiveTabChanged="clientActiveTabChanged"
        id="TabContainer1"
    .....
    <cc1:TabPanel ID="tpServer" runat="server">
    ....
    <cc1:TabPanel ID="tpLAR" runat="server">
                    <HeaderTemplate>Logical Access Review
                    </HeaderTemplate>
                    <ContentTemplate>
                        <table class="LARReviewTable">
                            <tr>
                                <td width="25%">
                                    1.
                                    <asp:CheckBox ID="chkSOSCompleted" runat="server" 
                                        Text="SOS Activities Completed" TextAlign="Left">
                                    </asp:CheckBox>
                                    <td width="25%">
                                        2. Reason(Optional):<asp:TextBox ID="txtLARReason" runat="server" 
                                            TextMode="MultiLine" Width="90%"></asp:TextBox></td>
                                    <td>
                                        3. By Whom:
                                        <asp:TextBox ID="txtLARReviewer" runat="server"></asp:TextBox>
                                    </td>
                                    <td>
                                        4. SOS Date Completed
                                        <asp:Label ID="lblLARDate1" runat="server"></asp:Label>
                                        <asp:TextBox ID="txtLARCompleteDate" runat="server" Width="120px"></asp:TextBox>
                                        <img id="IMG1" alt="Date First Issued" class="NextCalendar_button" 
                                            src="../Images/calendar.png">&#160;<cc1:CalendarExtender ID="CalendarExtender1" 
                                            runat="server" Enabled="True" Format="dd/MM/yyyy" PopupButtonID="IMG1" 
                                            TargetControlID="txtLARCompleteDate">
                                    </cc1:CalendarExtender>
    
                                </img>
                                    </td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    5. SignOff Manager:<asp:TextBox ID="txtLARManager" runat="server"></asp:TextBox></td>                            
                                
                                <td>
                                    6. SOS Signoff Date
                                    <asp:Label ID="lblLARDate2" runat="server"></asp:Label>
                                    <asp:TextBox ID="txtLARSignOffDate"  runat="server" Width="120px" ></asp:TextBox>
                                    <IMG class="NextCalendar_button" id="IMG2"
    												alt="Date First Issued" src="../Images/calendar.png">
                                    <cc1:CalendarExtender ID="CalendarExtender2" runat="server" Format="dd/MM/yyyy"
                                        PopupButtonID="IMG2" TargetControlID="txtLARSignOffDate" Enabled="True">
                                    </cc1:CalendarExtender>
                                        
                                </td>
    <td>
                                    Current LAR Status:</td>
                                
                                <td>
                                    &nbsp;<asp:Label ID="lblLARStatus" runat="server"></asp:Label></td>
                                
                            </tr>
    
                        </table>
    




    Tuesday, December 3, 2013 4:24 PM

All replies

  • User-933407369 posted

    hi mdivk,

    Not sure why this didn't work for you, but i tried it out and worked in my project .

    You need to debug your project and find the real error message, and check out your datebase datatable.

    Can you post the complete  markup or provide a simple demo, which can easily reproduce the problem?

    In order to help us to understand your issue better.

     Thanks.

    Wednesday, December 4, 2013 5:04 AM
  • User-10248131 posted

    Thanks for reply. The markup doesn't show value to the control although backend debug shows the value is assigned to it.

    Wednesday, December 4, 2013 9:35 AM
  • User-227760790 posted

    Had you checked out your data of the datatble? what is the ReviewDetail data ?

    dt.Rows(0)("ReviewDetail")

    it exists whether Special characters or garbled. for example, "i'm fine. <br/> <br/>and you?" ,the content is not shown to the textbox conrtrol.

    Thursday, December 5, 2013 2:42 AM
  • User-10248131 posted

    Had you checked out your data of the datatble? what is the ReviewDetail data ?

    dt.Rows(0)("ReviewDetail")

    it exists whether Special characters or garbled. for example, "i'm fine. <br/> <br/>and you?" ,the content is not shown to the textbox conrtrol.

    Yes I did, and

    dt.Rows(0)("ReviewDetail") does have a value
    Thursday, December 5, 2013 9:37 AM
  • User1051314974 posted

    check the load event of your page, there should be something overriding your code.

    Thursday, December 5, 2013 10:38 AM
  • User555306248 posted

    is there any Javascript error in IE console?

    Thursday, December 5, 2013 11:29 PM
  • User-10248131 posted

    Sorry for getting back here late: I don't see any error on the page, the issue only happens to some of the controls in the same tabpanel of the same tabcontainter.

    Tuesday, December 10, 2013 1:39 PM
  • User-227760790 posted

    Since we can not asily reproduce the problem, you'd better recreate the page and debug the page one by one.

    Tuesday, December 10, 2013 9:09 PM