Hi Jack.
You can try like this.
1) After getting the
primary key
from gridview using
javascript
, you can pass the primarykey as
query string
in the url
example ( window.location = ' your url.aspx?Key='your key' )
2) And in the
page load
method you can check the query string for that particular
key
as below.
string _primaryKey = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
_primaryKey = Request.QueryString["key"];
}
}
protected void GridViewJobList_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string primaryKey = DataBinder.Eval(e.Row.DataItem, "Entry_No") + "";
if (primaryKey == _primaryKey)
e.Row.BackColor = System.Drawing.Color.Blue;
}
}