代码之家  ›  专栏  ›  技术社区  ›  adhanlon

即使按钮属性OnClick设置为该函数,Button click也不会调用该函数

  •  0
  • adhanlon  · 技术社区  · 16 年前

    1 回复  |  直到 16 年前
        1
  •  1
  •   Community Mohan Dere    9 年前

    [剪-不是问题的一部分]

    编辑: 下面是一个调用按钮 OnClick UpdatePanel

    .aspx文件

    <form id="form1" runat="server">
        <asp:ScriptManager runat="server"></asp:ScriptManager>
        <asp:UpdatePanel ID="upTest" runat="server">
            <ContentTemplate>
                <asp:Button ID="btnTest" Text="Test" OnClick="Delete_Click"  runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
    

    .aspx.cs文件

    protected void Delete_Click(object sender, EventArgs e)
    {
        // Whatever you want to do.
    }
    

    :我最近给出了一个答案 figures out what control has caused a postback .

    推荐文章