我想用按钮显示从 DropDownList 输出的不同标签
select Item on DropDownList and click button to show output in label
谁能帮我解决这个问题?
我想用按钮显示从 DropDownList 输出的不同标签
select Item on DropDownList and click button to show output in label
谁能帮我解决这个问题?
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = DropDownList1.SelectedValue;
}
把这个写在button click event
protected void Button1_Click(object sender, EventArgs e) {
label.text = ComboBox.SelectedText;
}
protected void Button1_Click(object sender, EventArgs e)
{
lable1.Text=DropDownList1.SelectedValue.ToString();
}
或者你可以
protected void Button1_Click(object sender, EventArgs e)
{
String input=DropDownList1.SelectedIndex >= 0 ? DropDownList1.SelectedItem.ToString() : "";
lable1.Text=input;
}