how exactly can I make control-events inside of a contenttemplate work? It’s annoying enough that I can’t access controls directly, but now the events don’t even fire for whatever reason? I’m starting to hate webprogamming…
Front:
<act:TabContainer ID="tcTabellen" runat="server" TabIndex="0" AutoPostBack="true">
<act:TabPanel ID="tpBeitragssaetze" HeaderText="Beitragssätze" runat="server">
<ContentTemplate>
<p>
<asp:Label ID="lbKasse" runat="server">Kasse</asp:Label>
<asp:DropDownList runat="server" ID="ddlKasse" AutoPostBack="true"></asp:DropDownList>
<asp:Label ID="lbJahr" runat="server">Jahr</asp:Label>
<asp:DropDownList runat="server" ID="ddlJahr" AutoPostBack="true"></asp:DropDownList>
</p>
</ContentTemplate>
</act:TabPanel>
</act:TabContainer>
Behind:
WithEvents ddlKasse As DropDownList
WithEvents ddlJahr As DropDownList
Private Sub ddlKasse_DataBind()
ddlKasse = CType(Me.tcTabellen.FindControl("tpBeitragssaetze").FindControl("ddlKasse"), DropDownList)
ddlKasse.AutoPostBack = True
ddlKasse.Items.Clear()
ddlKasse.Items.Insert(0, New ListItem With {.Text = "Bitte auswählen ...", .Value = "0"})
ddlKasse.Items.Insert(1, New ListItem With {.Text = "01 - BKK Höchst (W)", .Value = "01"})
ddlKasse.Items.Insert(2, New ListItem With {.Text = "02 - BKK Höchst (O)", .Value = "02"})
ddlKasse.Items.Insert(3, New ListItem With {.Text = "10 - BKK Gesundheit (Alt) (W)", .Value = "10"})
ddlKasse.Items.Insert(4, New ListItem With {.Text = "13 - Sancura BKK (W)", .Value = "13"})
ddlKasse.Items.Insert(5, New ListItem With {.Text = "21 - DKV (W)", .Value = "21"})
ddlKasse.Items.Insert(6, New ListItem With {.Text = "22 - DKV (O)", .Value = "22"})
ddlKasse.Items.Insert(7, New ListItem With {.Text = "32 - BKK Vita-Dyckerhoff (W)", .Value = "32"})
ddlKasse.Items.Insert(8, New ListItem With {.Text = "34 - BKK Gesundheit (W)", .Value = "34"})
ddlKasse.Items.Insert(9, New ListItem With {.Text = "35 - BKK Gesundheit (O)", .Value = "35"})
ddlKasse.Items.Insert(10, New ListItem With {.Text = "56 - STJB (W)", .Value = "56"})
ddlKasse.Items.Insert(11, New ListItem With {.Text = "69 - BKK Bodensee + Südwest (W)", .Value = "69"})
ddlKasse.Items.Insert(12, New ListItem With {.Text = "71 - STJB (O)", .Value = "71"})
ddlKasse.Items.Insert(13, New ListItem With {.Text = "82 - BKK Vita Dyckerhoff (O)", .Value = "82"})
ddlKasse.Items.Insert(14, New ListItem With {.Text = "83 - BKK Gesundheit (Alt) (O)", .Value = "83"})
ddlKasse.Items.Insert(15, New ListItem With {.Text = "84 - Sankura BKK (O)", .Value = "84"})
ddlKasse.Items.Insert(16, New ListItem With {.Text = "93 - BKK FPB Holding (W)", .Value = "93"})
End Sub
Private Sub ddlKasse_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlKasse.SelectedIndexChanged
ddlJahr_DataBind()
End Sub
I just want one ddl to be filled if the selectedindex of another one changes, but as I mentioned before .. the event doesn’t fire.
Does anybody have a clue what it is like that and how I can fix it?
Thanks in advance!
Your ddl needs the onselectedindexchanged on its tag: