Take a look at the following code:
Use the DataNavigateUrlFields
property, comma-delimited value with the fields for parameters in "KeywordSrchSumDtl.aspx?Keyword={0}&State={1}&City={2}"
A couple of examples:
Passing two arguments in DataNavigateUrlFormatString in hyperlink field of .NET 2.0 Grid-View
Pass Multiple Values from a GridView to Another Page using ASP.NET
EDIT:
Set NavigateUrl
of HyperLink in RowDataBound
event of GridView
.......
Code behind:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
HyperLink hl = (HyperLink)e.Row.FindControl("link");
if (hl != null)
{
DataRowView drv = (DataRowView)e.Row.DataItem;
string keyword = drv["Keyword"].ToString();
string state = Request.QueryString["State"];
string city = Request.QueryString["City"];
hl.NavigateUrl = "~/KeywordSrchSumDtl.aspx?Keyword=" + keyword + "&State=" + Server.UrlEncode(state) + "&City=" + Server.UrlEncode(city);
}
}
}