0
votes

I have a hyperlink field in my gridview as below:

<asp:HyperLinkField DataNavigateUrlFields="runId" DataTextField="runId" HeaderText = "RunID" DataNavigateUrlFormatString="RunAnalysis.aspx"/>

Its basically a runId. Clicking this hyperlink will redirect to a page called RunAnalysis. I want to access the value of the runId which was clicked in this page.

I was thinking of using a query string but there is no event as far as I know that is fired on click of the hyperlink.

How to access the runId value in this page? Is there an event fired so to send a query string?

1
<asp:HyperLinkField DataNavigateUrlFields="runId" DataTextField="runId" HeaderText = "RunID" DataNavigateUrlFormatString="RunAnalysis.aspx"/>Neha
I m not sure about that but, you can try "CommandArgument" property to pass runIDDev

1 Answers

1
votes

Should be fairly easy to do with query string. Make sure you pass the parameter:

DataNavigateUrlFormatString="RunAnalysis.aspx?runId={0}"

The value for the placeholder will be picked up from DataNavigateUrlFields, which you already have correctly setup.

In the code behind of the RunAnalysis.aspx page all you need to do is just to read the passed value from the Request object:

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