I'm experiencing an issue getting my UpdatePanel to work properly in a C# ASP.NET project. It's identical code to multiple other pages in my solution, but has unusual behavior on this page. The goal is simply to allow the user to change a radio button which then alters the visibility of various table rows further down in the UpdatePanel. Interestingly enough, the CheckBox works as expected.
In my current page, I have the following code:
<
asp:UpdatePanel
ID
=
"updatePanel"
runat
=
"server"
UpdateMode
=
"Conditional"
>
<
ContentTemplate
>
<
span
class
=
"stepTitle"
>Set Fluid Properties</
span
>
<
div
class
=
"calculateInnerDiv"
>
<
asp:RadioButtonList
ID
=
"FluidTypeList"
runat
=
"server"
AutoPostBack
=
"true"
RepeatDirection
=
"Horizontal"
TabIndex
=
"101"
OnSelectedIndexChanged
=
"FluidTypeList_Changed"
>
<
asp:ListItem
Text
=
""
Value
=
"Liquid"
/>
<
asp:ListItem
Text
=
""
Value
=
"Gas"
/>
<
asp:ListItem
Text
=
""
Value
=
"Steam"
/>
</
asp:RadioButtonList
>
<
asp:CheckBox
ID
=
"IsCompressibleCheckBox"
runat
=
"server"
AutoPostBack
=
"true"
Text
=
"Fluid Is Compressible"
Checked="<%# model.isCompressible %>" TabIndex="101" OnCheckedChanged="IsCompressible_Changed" />
.
.
.
However, when it renders, there is an extra RadAjaxPanel that is being created, as seen below. This panel does not get generated in any of the other pages with a similar process. Due to the extra panel, I receive a JS error of "Uncaught TypeError: Cannot read property 'id' of null" in "Telerik.Web.UI.WebResource.axd:3776". It also displays "867|updatePanel|ctl00_ctl00_mainHolder_FluidTypeListPanel|" on the page.
<
div
id
=
"mainHolder_updatePanel"
>
<!-- this is the main UpdatePanel -->
<
span
class
=
"stepTitle"
>Set Fluid Properties</
span
>
<
div
class
=
"calculateInnerDiv"
>
<
div
class
=
"RadAjaxPanel"
id
=
"ctl00_ctl00_mainHolder_FluidTypeListPanel"
>
<!-- this should not exist and throws errors like I have nested update panels -->
<
table
id
=
"mainHolder_FluidTypeList"
>
<
tr
>...</
tr
>
</
table
>
</
div
>
<
input
id
=
"mainHolder_IsCompressibleCheckBox"
type
=
"checkbox"
name
=
"ctl00$mainHolder$IsCompressibleCheckBox"
onclick
=
"javascript:setTimeout('__doPostBack(\'ctl00$mainHolder$IsCompressibleCheckBox\',\'\')', 0)"
tabindex
=
"101"
/>
.
For my codebehind, I run a case statement that hides/displays certain fields based on the selection, and then it calls updatePanel.Update(). Any suggestions are absolutely welcome as I'm at my wit's end on this.
Thank you for your time.