Noob question - Need variable from DB field

A

Arch Stanton

I have some data returned via a SQL statement (from MS Access) to a
datagrid on an ASPX page. One of my datagrid columns is a hyperlink
column. Everything works fine, but I need to pass the variable my user
clicks to another page.

Here's the code for my hyperlink column:

<asp:hyperlinkcolumn
datatextfield="SiteID"
headertext="Site ID"
datanavigateurlfield="SiteID"
datanavigateurlformatstring="CTSingleSite.aspx?SiteID=12-236" />

This code passes the string "12-236" to the receiving page just great,
but I need to replace that string with the string variable "SiteID" used
in this tag. I tried this:

datanavigateurlformatstring= _
"CTSingleSite.aspx?SiteID= '" & SiteID & "'"

But this causes an error. How can I pass the actual variable value, not
a hard-coded value?

Thanks much for any help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top