我有以下代码应该以模态弹出方式运行:
#region events
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
dt = DataObj.GetDataTable("GetScheduleNames");
foreach (DataRow myrow in dt.Rows)
{
SchedNameLst.Add(Convert.ToString(myrow["ScheduleName"]));
}
SchedNameListDD.DataSource = SchedNameLst;
SchedNameListDD.DataBind();
}
}
protected void SchedNameListDD_SelectedIndexChanged(object sender, EventArgs e)
{
// should be in selected index fired event
SchedName.Text = SchedNameListDD.SelectedItem.Text;
string name = SchedNameListDD.SelectedItem.Text;
dt = DataObj.GetDataTable("GetSchedDetails", name);
foreach (DataRow myrow in dt.Rows)
{
StartTime.Text = myrow["StartTime"].ToString();
EndTime.Text = myrow["EndTime"].ToString();
}
dt = DataObj.GetDataTable("GetSchedDetailsSat", name);
foreach (DataRow myrow in dt.Rows)
{
SatSt.Text = myrow["StartTime"].ToString();
SatEt.Text = myrow["EndTime"].ToString();
}
}
#endregion
当我在下拉列表中更改我的项目选择时,我的selectedIndexChanged事件不会被触发..是这样的吗?
答案 0 :(得分:0)
AutoPostBack = "true"
EnableViewState="true"
,确保启用了viewstate 答案 1 :(得分:0)
使用onchange =&#34; javascript:__ doPostBack(&#39; 下拉列表&#39; <#> Patameters &#39;)&# 34;