我有一個下拉列表,我在其中動態添加列表項。我將autopostback設置爲true,但是當我在下拉列表中選擇一個項目時似乎沒有發生。回傳不工作?
標記
`<asp:DropDownList runat="server" AutoPostBack="true" ID="restaurant_city_con" CssClass="selectboxindex"></asp:DropDownList>`
代碼
`if (!this.IsPostBack)
{
addStates();
showData();
dashboardPageFunction();
ordersPageFunction();
reportsPageFunction();
categoriesPageFunction();
menuPageFunction();
offersPageFunction();
bookingPageFunction();
}
else
{
addCities();
addZipCode();
}`
的背後有什麼我做錯了嗎?
你需要添加一個SelectedIndexChanged事件以及 –
仍不加工。 –
您是否嘗試過使用selectedindexchanged事件中的斷點進行調試? –