ボタンで 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;
}