After changing my ListBox to a DropDownList I noticed another issue and it could just be me so forgive me if I'm just doing it wrong but here goes.
Ok so I have a CustomControl this control is made up of several Panels of which some are hidden and others are not based on the users progress through the questionnaire.
Markup Snippet:
<asp:Label ID="Sec1Q8Label" resourcekey="Sec1Q8Label" runat="server" />
<asp:DropDownList ID="Sec1Q8" OnSelectedIndexChanged="Sec1Q8SelectChanged" runat="server" Rows="1" CausesValidation="false" AutoPostBack="true">
<asp:ListItem resourcekey="Sec1Q8Option0" />
<asp:ListItem resourcekey="Sec1Q8Option1" />
<asp:ListItem resourcekey="Sec1Q8Option2" />
<asp:ListItem resourcekey="Sec1Q8Option3" />
<asp:ListItem resourcekey="Sec1Q8Option4" />
<asp:ListItem resourcekey="Sec1Q8Option5" />
<asp:ListItem resourcekey="Sec1Q8Option6" />
<asp:ListItem resourcekey="Sec1Q8Option7" />
</asp:DropDownList>
<asp:Label ID="Sec1Q8OtherLabel" resourcekey="Sec1Q8OtherLabel" runat="server" Visible="false" />
<asp:TextBox ID="Sec1Q8Other" resourcekey="Sec1Q8Other" runat="server" Visible="false" />
Code Snippet:
protected void Sec1Q8SelectChanged(object sender, EventArgs e)
{
if (((DropDownList)sender).SelectedIndex == 7)
{
Sec1Q8OtherLabel.Visible = true;
Sec1Q8Other.Visible = true;
}
else
{
Sec1Q8OtherLabel.Visible = false;
Sec1Q8Other.Visible = false;
}
}
Now the problem is this in the PostBack the DropDownList appears to be rebuild from scratch nulling out the selection. The same is true for RadioButtonList, I haven't tested any other than standard TextBox which is NOT regenerated and DOES retain its inputted value. I know this control works in a normal web form environment but prehaps I have got in over my head as far as understanding how DNN is implementing the web form.
Any information would be great.
Thanks again,
Josh
PS.
I did report the enhancement you wanted me to do Sebastian