0
aspのボタンをhtmlボタンに変換したいのですが。ASP.NETボタンをHTMLボタンに変換
<asp:ImageButton ID="UpdateButton" runat="server" CausesValidation="True" ValidationGroup="EditCustomer" CommandName="UpdateRow" ToolTip="Accept Changes" ImageUrl="~/Web/Images/accept-40x40.png" />
の背後にあるコード:
protected void FormView1_ItemCommand(object sender, FormViewCommandEventArgs e)
{
switch (e.CommandName)
{
case "UpdateRow":
UpdateCustomer();
FormView1.ChangeMode(FormViewMode.ReadOnly);
DisplayCustomer((int)FormView1.DataKey.Value);
break;
}
}
私のHTMLボタンは、現在動作していない。..
<button type="button" class="btn btn-sm btn-success" title="Edit" ID="UpdateButton" runat="server" onserverclick="UpdateRow">
'CommandName'と' onserverclick'は同じではありません。 ItemCommandのコマンド名をそのようなhtmlボタンにコピーすることはできません。 – VDWWD