動的なドロップダウンコントロールを備えたasp.netページがありselectedIndexchanged
、ユーザーが選択した場合にのみイベントを起動する必要があります。
現在selectedIndexchanged
、プログラムで選択が変更されるたびにイベントが発生しています。
selectedIndexchanged
「ユーザー」の選択のみでイベントをチェック/発生させる方法を提案できる人はいますか?
動的なドロップダウンコントロールを備えたasp.netページがありselectedIndexchanged
、ユーザーが選択した場合にのみイベントを起動する必要があります。
現在selectedIndexchanged
、プログラムで選択が変更されるたびにイベントが発生しています。
selectedIndexchanged
「ユーザー」の選択のみでイベントをチェック/発生させる方法を提案できる人はいますか?
私はあなたのためにこの仕事を願っています
protected void Page_Load(object sender, System.EventArgs e){
DropDownList cbTest = new DropDownList();
cbTest.ID = "cbot";
//create an event handler for the SelectedIndexChanged event
cbTest.SelectedIndexChanged += new EventHandler(cbt_SelectedIndexChanged);
cbTest.Items.Add("1");
cbTest.Items.Add("2");
cbTest.Items.Add("3");
//set the AutoPostBack property to sends the data back to the server
cbTest.AutoPostBack = true;
this.form1.Controls.Add(cbTest);
}
//handle the selections made by the User
void cbt_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Write("This works");
}