GridView按钮传值非模板

                <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False"
                    DataKeyNames="team_autoid,route_autoid" onrowcommand="GridView3_RowCommand"
                    onrowdatabound="GridView3_RowDataBound" CellPadding="4"
                    ForeColor="#333333" GridLines="None" Width="95%">
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <RowStyle BackColor="#EFF3FB" Height="25px" />
                    <Columns>
                        <asp:BoundField DataField="team_autoid" HeaderText="team_autoid" />
                        <asp:BoundField DataField="route_autoid" HeaderText="route_autoid" />
                        <asp:BoundField DataField="state" HeaderText="state" />

                       <asp:ButtonField DataTextField="team_name" HeaderText="线路名称" Text="按钮">
                           <ItemStyle HorizontalAlign="Left" />
                        </asp:ButtonField>
                       
                        <asp:BoundField DataField="team_numberDay" HeaderText="天数" />
                        <asp:BoundField DataField="team_godate_start" HeaderText="日期"
                            DataFormatString="{0:d}" >
                            <ItemStyle Width="60px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="route_validity_end" HeaderText="截至日期"
                            DataFormatString="{0:d}" >
                            <ItemStyle Width="60px" />
                        </asp:BoundField>
                    </Columns>
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White"
                        Height="25px" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>

 

    protected void GridView3_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        GridViewRow item = this.GridView3.Rows[Convert.ToInt32(e.CommandArgument)];

        string TC_id = Request.QueryString["TC_id"];
        string state = item.Cells[2].Text;
        if (state != "planRoute")
        {
            string team_autoid = item.Cells[0].Text;
            Session["team_autoid"] = team_autoid;
            recP("TEM" + team_autoid);
            Response.Redirect("~/salesCenter/travel/salesTravel_teamShow.aspx?menu_second=sec12&menu_tab=4&TC_id=" + TC_id);
        }
        else
        {
            string route_autoid = item.Cells[0].Text;
            Session["route_autoid"] = route_autoid;
            recP("ROU" + route_autoid);
            Response.Redirect("~/salesCenter/travel/salesTravel_planRouteShow.aspx?menu_second=sec12&menu_tab=4&TC_id=" + TC_id);
        }

    }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值