
Untitled
By: a guest on
May 21st, 2012 | syntax:
None | size: 0.77 KB | hits: 17 | expires: Never
GridView pass parameter in url and use in another page
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() + "')";
}
}
string id =Request.QueryString["id"];
Request.QueryString["name"]
string GetQueryStringVarible(string name, string defaultValue)
{
if(!string.IsNullOrEmpty(Request.QueryString[name])
{
return Request.QueryString[name];
}
else
{
return defaultValue;
}
}