110,561
社区成员
发帖
与我相关
我的任务
分享
<asp:GridView id="GridView1" runat="server" GridLines="Horizontal" CellPadding="3" BorderWidth="1px" BorderStyle="None" BorderColor="#E7E7FF" BackColor="White" AutoGenerateColumns="False" nRowDataBound="GridView1_RowDataBound" OnRowCommand="GridView1_RowCommand">
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton id="LinkButton1" runat="server" Text="报修" CausesValidation="false" CommandArgument='<%# Eval("EquipmentID") %>' CommandName="cmdFaultReport" OnClientClick="javascript:return confirm('确认要报修该设备吗?')"></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="center" Width="50px"></ItemStyle>
</asp:TemplateField>
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "cmdFaultReport")
{
Hashtable ht = new Hashtable();
ht.Add("EquipmentState", "2");
string where = " where EquipmentID=";
where += "'" + e.CommandArgument.ToString() + "'";
TabEquipmentFixed.Update(ht, where);
//
BindData();
}
}
js = "javascript:if(confirm('是否确认删除!')==true) Page_ClientValidate();else return false;"; //加入判断对话框
this.btnDel.Attributes.Add("onclick", js);