我尝试在 rowcommand 事件上使用带有我的 datagridview 的更新面板来显示一个对话框。当我删除更新面板时它工作正常,但它不起作用。
我用更新面板尝试了以下配置,但它不起作用。
<asp:UpdatePanel ID="UpdatePaneldgv" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
<Triggers >
<asp:AsyncPostBackTrigger ControlID="dgvVehiclesType" EventName ="RowCommand" />
</Triggers>
<ContentTemplate>
<div class="tab-content">
<div class="tab-pane fade in active">
<asp:GridView ID="dgvVehiclesType" runat="server" GridLines="None" OnRowCommand="dgvVehiclesType_RowCommand" PageSize="10">
<Columns>
<asp:BoundField DataField="OptionID" HeaderText="# ID" ReadOnly="True"/>
<asp:BoundField DataField="OptionName" HeaderText="Name" ReadOnly="True" />
<asp:ButtonField ButtonType="Image" CommandName="cmdEdit" ImageUrl="~/img/view.png" />
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
行命令后端事件
switch (e.CommandName)
{
case "cmdEdit":
// show form
ClientScript.RegisterStartupScript(GetType(), "Show", "<script> $('#formModal').modal('toggle');</script>");
break;
default:
break;
}
有什么建议吗??或参考