gridVew传多值到下个页面

本文介绍如何在 ASP.NET 中使用 GridView 控件为每行设置双击事件以打开新页面,并展示具体实现代码。此外,还介绍了如何在新页面中获取传递的参数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 protected void gvShowOut_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {

           一: e.Row.Attributes["ondblclick"] = String.Format("javascript:dbl_click=true;window.open('Leave.aspx?flowInId={0}&fI_H_ID={1}','_blank','height=540, width=750px, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');", gvShowOut.DataKeys[e.Row.RowIndex].Values[0].ToString(), gvShowOut.DataKeys[e.Row.RowIndex].Values[1].ToString());            
         二: e.Row.Attributes["ondblclick"] = String.Format("javascript:dbl_click=true;window.open('Leave.aspx?flowInId={0}&fI_H_ID={1}','_blank','height=540, width=750px, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');", DataBinder.Eval(e.Row.DataItem,"FlowIn_ID").ToString(), DataBinder.Eval(e.Row.DataItem,"FI_H_ID").ToString());

             三:e.Row.Attributes["ondblclick"] = "javascript:window.open('Leave.aspx?flowInId=" + DataBinder.Eval(e.Row.DataItem, "FlowIn_ID").ToString() + "&fI_H_ID=" + DataBinder.Eval(e.Row.DataItem, "FI_H_ID").ToString() + "','_blank','height=540, width=750px, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');";
            e.Row.Attributes["title"] = "双击打开详细页面";
         }

}

 

下个页面接收:

int id = Convert.ToInt32(Request.QueryString["flowInId"].ToString());

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值