日期:2014-05-17  浏览次数:20564 次

请问删除按钮当它禁用之后,怎么样才能不让客户端事件触发呢?
具体情况是这样,删除的时候,有确定删除提示框,当禁用之后,再点击的时候,不应该弹出提示框,可是为什么还能弹出呢?  
代码如下

asp:TemplateField HeaderText="操作" ShowHeader="False">
  <ItemTemplate>
  <asp:LinkButton ID="lbtnDelete" runat="server" CausesValidation="False" 
  CommandName="Delete" Text="删除" OnClientClick="return confirm('确定删除?')"></asp:LinkButton>
  </ItemTemplate>
  <ItemStyle Wrap="False" HorizontalAlign="Center"></ItemStyle>
  </asp:TemplateField>




 protected void gvOrder_RowDeleting(object sender, GridViewDeleteEventArgs e)
  {
  //this.gvOrder.Rows[e.RowIndex].Cells[4].Attributes.Add("onclick", "javascript:return confirm('你确认要删除吗?')");
  Label lpid = this.gvOrder.Rows[e.RowIndex].Cells[0].FindControl("lblPID") as Label;
  string _productID = "";
  if (lpid != null)
  _productID = lpid.Text;
  //string orderID = labOrderID.Text + " and productID=" + _productID;
  LO_Order order = new LO_Order();
  order.GUID = labOrderID.Text;
  order.productID = Convert.ToInt32(lpid.Text);
  int count = Mapper.Get().Delete("DeleteLO_Order", order);

  IList<LO_Order> order_list = Session["order_list"] as IList<LO_Order>;
  if (order_list != null)
  {
  foreach (LO_Order item in order_list)
  {
  if (item.productID.ToString() == _productID)
  {
  order_list.Remove(item);
  break;

  }

  }
  }

  Session["order_list"] = order_list;
  Session["shop"] = null;

  BindView();

  }


请大侠帮帮看看

------解决方案--------------------
Enabled="flase"
------解决方案--------------------
HTML code

<asp:LinkButton ID="lbDel" runat="server" Text="Delete" onclick="lbDel_Click"></asp:LinkButton>