You can also pass a navigation url from code located just like that.
On the Aspx page
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="hyp" runat="server" Text="Navigation"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
In the field "Code for binding to user grid data", as shown
protected void grddata_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
int ID = Convert.Int32(DataBinder.Eval(e.Row.DataItem, "ID"));
HyperLink hyp = (HyperLink)e.Row.FindControl("hyp");
hyp.NavigateUrl = "Test.aspx?Name='" + Request.QueryString["test"] + "'&&ID"+ ID +"";
}
}
I think this will help you ...
source
share