在GridView中LinkButton的双击事件
来源:互联网 发布:机器人编程课程 编辑:程序博客网 时间:2024/04/27 15:01
protected void lbtnShenHe_Click(object sender, EventArgs e)
{
int lbtn =Convert.ToInt32(((LinkButton)sender).CommandArgument) ;
string strSQL = "UPDATE tb_Order SET Verify=0 WHERE userID=" + lbtn + "";
try
{
if (DbHelper.GetInstance().ExecuteSql(strSQL))
{
JSHelper.Alert("该表单审核成功!", this.Page);
gvOrder.DataBind();
}
}
catch
{
JSHelper.Alert("操作失败!", this.Page);//JSHelper是一个弹窗的一个类
}
}
——————————————————————————————————————————————————
<asp:GridView ID="gvOrder" runat="server" AutoGenerateColumns="False" CellPadding="4"
DataKeyNames="userID" DataSourceID="AccessDataSource1" ForeColor="#333333" GridLines="None"
Width="80%" CellSpacing="1">
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White"
Height="20px" />
<RowStyle BackColor="#EFF3FB" />
<Columns>
<asp:BoundField DataField="userID" HeaderText="用户编号" InsertVisible="False" ReadOnly="True"
SortExpression="userID" />
<asp:BoundField DataField="userName" HeaderText="用 户 名" SortExpression="userName" />
<asp:BoundField DataField="mobilePhone" HeaderText="手 机" SortExpression="mobilePhone" />
<asp:BoundField DataField="pronum" HeaderText="商品" SortExpression="pronum" />
<asp:BoundField DataField="number" HeaderText="件数" SortExpression="number" />
<asp:BoundField DataField="address" HeaderText="联系地址" SortExpression="address" />
<asp:BoundField DataField="phone" HeaderText="联系电话" SortExpression="phone" />
<asp:BoundField DataField="QQ" HeaderText="QQ" SortExpression="QQ" />
<%-- <asp:BoundField DataField="remark" HeaderText="备 注11" SortExpression="remark" />--%>
<asp:TemplateField HeaderText="备 注">
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Eval("remark") %>' Title='<%# Eval("remark") %>'></asp:Label>
</ItemTemplate>
<ControlStyle Width="150px" CssClass="longtext" />
<FooterStyle Width="150px" CssClass="longtext" />
<HeaderStyle Width="150px" CssClass="longtext" />
<ItemStyle Width="150px" CssClass="longtext" />
</asp:TemplateField>
<asp:TemplateField HeaderText="发货状态">
<ItemTemplate>
<asp:Label ID="labStatus" runat="server" Text='<%# BindState(Eval("FinishedState")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="审核状态">
<ItemTemplate>
<asp:Label ID="labVerify" runat="server" Text='<%# BindVerify(Eval("Verify")) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="用户操作">
<ItemTemplate>
<asp:LinkButton ID="lbtnShenHe" runat="server" CommandArgument='<%# Eval("userID") %>'
OnClick="lbtnShenHe_Click" ForeColor="Blue" Font-Underline="true">审核</asp:LinkButton>
<a style='display: <%# Eval("FinishedState").ToString()=="0"?"none":"" %>' href="javascript:alert('您已经操作成功!')">
</a> <asp:LinkButton ID="lbtnShipping" runat="server" ForeColor="Blue" Font-Underline="true"
OnClick="lbtnShipping_Click" CommandArgument='<%# Eval("userID") %>'>退回</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<EmptyDataTemplate>
对不起,暂时无任何数据
</EmptyDataTemplate>
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#2461BF" />
<AlternatingRowStyle BackColor="White" Font-Size="Larger" />
</asp:GridView>
——————————————————————————————————————————————————
- 在GridView中LinkButton的双击事件
- 在GridView里的LinkButton和绑定事件的操作
- gridview使用TemplateField中的LinkButton时如何在RowCommand事件中找到当前行index的方法
- gridview中鼠标双击事件
- (转)在GridView中使用模板列LinkButton,如何知道当前的LinkButton点击在哪行记录上?
- 在GridView中使用模板列LinkButton,如何知道当前的LinkButton点击在哪行记录上? .
- GridView中妙用LinkButton
- 在GridView中LinkButton的属性的应用(如何不用选中就删除这一行)
- 在gridview中使用linkbutton实现禁止启动操作。
- GridView行的单击/双击事件
- 实现 gridview行的双击事件
- 给自定义的gridview添加双击事件
- gridview 双击单击事件
- GridView中使用LinkButton,获取LinkButton上的ID值,用于跳转到编辑页面
- 如何用Js写history.back()在linkButton的onclick事件中
- 根据数据库字段改变GridView中LinkButton的Text
- 获取GridView的TemplateField模版中LinkButton列值
- LinkButton及RowCommand事件中获取Gridview中行索引并此行变色
- c++ char类型用法小结
- allocator
- HTML中Label标签使用
- C#代码组织: project over folder
- 新的征程
- 在GridView中LinkButton的双击事件
- C#连接数据库及数据绑定
- .NET(C#)连接各类数据库-集锦
- 软件工程师不可不知的10个概念
- 这么大了还不知道做什么好
- 永不放弃
- 如何使用Oracle的分析函数ROW_NUMBER、DENSE_RANK、RANK
- C#命名规范
- 一表十万地址,另一表四十五万地址,分析地址相似度,并作关联