【问题标题】:Problems with confirm on ASP.NET在 ASP.NET 上确认的问题
【发布时间】:2011-04-14 21:08:52
【问题描述】:

这很奇怪,我在列表视图中有一个 asp:ImageButton,我想在执行该方法之前确认并采取行动,但我不能

然后我在列表视图之外创建了另一个图像按钮,确认确实有效,你们能告诉我为什么吗?

这不起作用

<asp:ImageButton ID="btnEnabled" OnCommand="CommandExecution"  OnClientClick="return confirm('Desea eliminar el cliente ?');"  ImageUrl="~/App_Themes/Default/images/Habilitar.png"
                Visible='<%# Eval("IsEnabled") %>' CommandName="ChangeStatus" ToolTip="Deshabilitar distribuidor"
                runat="server" CommandArgument='<%# Eval("IdClient") %>' />

这个可以

<asp:ImageButton ID="btnConfirmacion3"  ImageUrl="~/App_Themes/Default/images/Habilitar.png" runat="server" Text="Confirmacion 3" OnClientClick="return confirm('Desea eliminar el cliente ?');"   />

【问题讨论】:

    标签: asp.net listview onclientclick


    【解决方案1】:

    AutoPostback 设置为假。然后为命令名称和参数创建两个隐藏的文本框。然后在页面中放置一个隐藏的链接按钮。在确认将命令名称和参数放置在隐藏框中,然后调用链接按钮的回发方法后,在图像按钮的 onclientclick 事件中。然后在链接按钮事件处理程序中处理命令。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-04
      • 1970-01-01
      相关资源
      最近更新 更多