Cannot have multiple items selected in a DropDownList

后端 未结 8 866
暖寄归人
暖寄归人 2020-12-30 19:11

I have two dropdownlist and a button. I used the breakpoint in my project and everything is working fine. But as soon I am getting out of the function of the button this is

8条回答
  •  轮回少年
    2020-12-30 20:05

     protected void Button1_Click(object sender, EventArgs e)
        {
    
            if (ddlPlayer1.SelectedIndex>0 || ddlPlayer2.SelectedIndex>0)
            {
                lblPlayer1Score.Text = Repository.Instance.ReturnScore(ddlPlayer1.SelectedValue.ToString(), ddlPlayer2.SelectedValue.ToString()).Rows[0][0].ToString();
                lblPlayer2Score.Text = Repository.Instance.ReturnScore(ddlPlayer2.SelectedValue.ToString(), ddlPlayer1.SelectedValue.ToString()).Rows[0][0].ToString();
    
    
            }
    
        }
    

提交回复
热议问题