0
我正在使用jquery simple modal。jquery modal沒有從asp下拉列表中選擇值
function showCancelledModal() {
$('#<%=CancelledPanel.ClientID %>').modal({ appendTo: 'form' });
}
<asp:Panel ID="CancelledPanel" runat="server" Style="display: none">
<asp:DropDownList ID="CancelledDropDownList" runat="server"></asp:DropDownList>
<asp:Button ID="CancelButton" runat="server" Text="Cancel" OnClick="CancelButton_Click" />
</asp:Panel>
protected void CancelButton_Click(object sender, EventArgs e)
{
var item = CancelledDropDownList.SelectedItem.Value;
//CancelReservation(strReservationId);
}
問題是,在我的按鈕單擊事件它似乎並沒有得到下拉列表中選定的值。它每次只默認第一個值。我將下拉列表綁定到頁面加載事件中的表格。
任何人都可以提供任何建議嗎?
提示:你重新綁定你的DDL後,復位selectedItem屬性。 – 2013-03-21 14:33:12