Question

I have a radgrid populated when my page initially loads. I set a column in my radgrid as a hyperlink and was wondering how to retain the value of that particular column in the row clicked so when a new page is loaded I can use the value stored to perform an SQL query on the new page.

I am wondering if this is possible and how I would go about doing this?

Was it helpful?

Solution

Welcome to SO Jacob, I have done this before and it's not hard at all.

Example:

My select statement is "select top 5 ProductName from products"

I then created a hyperlink column and assigned the properties under the data section as seen in the screenshot below.

When run, it makes the data clickable and when clicked, it navigates to the url seen in the SS.

If you want to use it in a querystring change the DataNavigateUrlFormatString to:

http://google.com?ProductName={0}

You would then read it on your new page via:

var a = Request.QueryString["ProductName"]; //C#
dim a = Request.QuesryString("ProductName") 'Vb.net

If this is what you are after, click the green checkmark next to my answer to accept it and alert future users that this is the solution.

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top