listview 中的按钮,在对话框中打开,而不是触发按钮单击事件。以下是相关代码:
<div id="AssetsListView">
<asp:ListView ID="lstviewAssetAssign" runat="server">
<LayoutTemplate>
<asp:Button ID="btnSaveAssetAssignFromListView" runat="server" Text="Save" OnClick="btnSaveAssetAssignFromListView_Click" />
<asp:Button ID="btnClearCheckboxesFromListView" runat="server" Text="Clear" OnClick="btnClearCheckboxesFromListView_Click" />
</LayoutTemplate>
</asp:ListView>
</div>
我正在使用以下对话框在对话框中打开此 Listview:
$(document).ready(function () {
$("#AssetsListView").dialog({
autoOpen: false,
show: "show",
hide: "hide",
modal: true,
draggable: false,
resizable: false,
width: 750
});
$(".gridviewbutton").unbind("click");
$(".gridviewbutton").bind("click", function () {
$("#AssetsListView").dialog("open");
});
这是事件处理程序声明:
protected void btnSaveAssetAssignFromListView_Click(object sender, EventArgs e)
{
// Some Code here
}
protected void btnClearCheckboxesFromListView_Click(object sender, EventArgs e)
{
// Some code here
}
我尝试在事件处理程序的开头添加断点,并且很确定事件不会在按钮单击时被触发。
一些帮助将不胜感激,谢谢。