0

Im new to ASP C# and I just want to ask on what is wrong on my code. It is going on the SelectedIndexChanged but not updating the visibility of my <tr>

Here is my ClientSide code

<tr id="trList2" runat="server" visible="false">
                                    <td>
                                        <asp:Label ID="lblList" AssociatedControlID="rcbList" runat="server" Text="Car List:" />
                                    </td>
                                    <td>
                                        <telerik:RadComboBox ID="rcbList" runat="server" Skin="Sunset" Width="400px" DataTextField="car_name"
                                             DataValueField="car_id" AppendDataBoundItems="true"
                                            OnSelectedIndexChanged="rcbList_SelectedIndexChanged" AutoPostBack="true" >
                                            <Items>
                                                <telerik:RadComboBoxItem Value="0" Text="[Select Project]" />
                                            </Items>
                                        </telerik:RadComboBox>

                                    </td>
                                </tr>
                                <tr id="trList4" runat="server" visible="false">
                                    <td>
                                       <asp:Label runat="server" AssociatedControlID="chkIsOpen">Check if Open</asp:Label>
                                    </td>
                                    <td>
                                         <asp:CheckBox runat="server" ID="chkIsOpen" OnCheckedChanged="IsOpen_CheckedChange" AutoPostBack="true" />
                                    </td>
                                </tr>

Here is my Server Side:

protected void rcbList_SelectedIndexChanged(object sender, EventArgs e)
    {
        var checkVal = rcbList.SelectedIndex;
        if (rcbList.SelectedValue != "0")
        {
            trList4.Visible = false;
        }
        else
        {

            trList4.Visible = true;
        }
    }

im getting the error Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: Could not find UpdatePanel with ID "xxx". If it is being updated dynamically then it must be inside another UpdatePanel in browser element but I dont have any updatepanel in my Page

Enrique Gil
  • 754
  • 4
  • 19
  • 50
  • You tagged this with `asp.net-mvc` but this not MVC, its WebForms. Check to see if this page is using a MasterPage and if so... is there an UpdatePanel on the MasterPage? – zgood Mar 15 '19 at 17:58
  • Check if this similar problem helps: https://stackoverflow.com/questions/3928253/could-not-find-updatepanel-with-id-xxx-if-it-is-being-updated-dynamically-the. I didn't see anything wrong in provided code, hence it may originated from other parts which not yet included here. – Tetsuya Yamamoto Mar 18 '19 at 01:05

0 Answers0