当前位置:编程学习 > C#/ASP.NET >>

实现点击Button后隐藏Button显示Label并获得shoppingcarid

--------------------编程问答--------------------

--前台改一点
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand"...
<asp:Button ID="ButIsPay" runat="server" Text=" 确认付款" CommandName="Pay" />


--后台
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Pay")
            {
                //处理你要处理的事
                Button ButIsPay = e.CommandSource as Button;
                Label LabIsPay = ButIsPay.Parent.FindControl("LabIsPay") as Label;
                ButIsPay.Visible = false;
                LabIsPay.Visible = true;
            }
        }
--------------------编程问答-------------------- 怎么获得shoppingcarid啊    现在主要要求获得shoppingcarid --------------------编程问答-------------------- 并且使用1楼你的方法之后报错误“GridView1_RowCommand”的重载均与委托“System.Web.UI.WebControls.GridViewCancelEditEventHandler”不匹配 F:\Visual Studio 2010\测试1\User\ShoppingCar.aspx
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,