The form has DropDownList and CheckBoxList
The value in the DropDownList should change depending on the CheckBoxList selection.
Put both elements in UpdatePanel .
The value in the DropDownList changes when you select (click) an item, and if you uncheck it, it does not change (it remains high)
aspx:

  Риск: <asp:UpdatePanel ID="UpRisk" runat="server" UpdateMode="always"> <ContentTemplate> <asp:DropDownList ID="ddlRiskLevel" runat="server" Enabled="false" AutoPostBack="True"> <asp:ListItem Text="Низкий" Value="1" Selected="True" /> <asp:ListItem Text="Высокий" Value="2" /> </asp:DropDownList> </ContentTemplate> </asp:UpdatePanel> <asp:UpdatePanel ID="UpdatePanel24" runat="server" UpdateMode="always"> <ContentTemplate> ΠŸΡ€ΠΈΠ·Π½Π°ΠΊΠΈ: <asp:CheckBoxList ID="chbList_Risks" runat="server"> <asp:ListItem> ΠΏΡ€ΠΈΠ·Π½Π°ΠΊ1 </asp:ListItem> <asp:ListItem> ΠΏΡ€ΠΈΠ·Π½Π°ΠΊ2 </asp:ListItem> <asp:ListItem> ΠΏΡ€ΠΈΠ·Π½Π°ΠΊ3 </asp:ListItem> </asp:CheckBoxList> </ContentTemplate> </asp:UpdatePanel> 

Code:

 protected void Page_Load(object sender, EventArgs e) { foreach (ListItem item in chbList_Risks.Items) { if (item.Selected) ddlRiskLevel.SelectedValue = "2"; } } 

    1 answer 1

    If I understand the question correctly, the "high" option should be selected if at least one checkbox is checked, otherwise the "low" option is chosen:

     protected void Page_Load(object sender, EventArgs e) { ddlRiskLevel.SelectedValue = "1"; foreach (ListItem item in chbList_Risks.Items) { if (item.Selected) ddlRiskLevel.SelectedValue = "2"; } } 

    For the chbList_Risks element chbList_Risks also set the AutoPostBack property to True :

     <asp:CheckBoxList ID="chbList_Risks" runat="server" AutoPostBack="True">