我已经在.Net中编写了代码。当我点击按钮,然后在事件下面开火。请帮忙怎么做。
protected void ddldesignation_SelectedIndexChanged(object sender, EventArgs e) { Code. }
检查按钮是否在页面的窗体集合中,可以将其用作停止触发下拉列表事件的条件。
protected void ddldesignation_SelectedIndexChanged(object sender, EventArgs e) { bool runEventCode = true; foreach (string ctl in Page.Request.Form) { Control c = Page.FindControl(ctl); if (c is Button) { runEventCode = false; break; } } if (runEventCode) { //Event handler code here } }