OnClickイベントが動作していない理由を私は知らない。asp:ImageButtonがOnClickイベントを発生させないのはなぜですか?
<div class="col-sm-1 pull-left" style="margin-top:20px">
<asp:ImageButton ID="delete_file"
OnClientClick="return confirm('Are you Sure ?');"
OnClick="delete_file_Click"
CausesValidation="false"
Visible="false"
class="btn btn-lg btn-default pull-left"
runat="server"
ImageUrl="~/img/del.png" />
</div>
C#コード:
protected void delete_file_Click(object sender, ImageClickEventArgs e)
{
int index = GridView2.SelectedIndex;
GridView2.DeleteRow(index);
}
画像ボタンは、リピータやデータリストのような他のコントロールの中に配置されていますか? – RajeeshMenoth
どのように 'Visible =" false "' ImageButtonをクリックしていますか? – Filburt
@Filburt:それは可視であるかもしれません=他のところからは "True"です。 – RajeeshMenoth