URL中的GridView传递参数并在另一个页面中使用 [英] GridView pass parameter in url and use in another page

查看:52
本文介绍了URL中的GridView传递参数并在另一个页面中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在URL中传递参数,但是,我不确定如何在下一页获取该ID.

I'm able to pass the parameter in the URL, however, i'm unsure of how to grab that ID on the next page.

我正在使用GridView传递参数onclick,以下是我正在使用的代码.

I'm using a GridView to pass the parameter onclick, below is the code i'm using.

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        e.Row.Attributes["onmouseover"] = "this.style.color='Black';this.style.cursor='hand';";
        e.Row.Attributes["onmouseout"] = "this.style.color='Black';";
        e.Row.Attributes["onclick"] = "window.navigate('NavigatedPage.aspx?id=" + e.Row.Cells[0].Text.ToString().Trim() + "')";
    }
}

我需要id =

谢谢!

推荐答案

在下一页上,执行:

 string id =Request.QueryString["id"];

这篇关于URL中的GridView传递参数并在另一个页面中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆