Setting Hyperlink URL in Gridview

W

Wayne Wengert

I have a gridview in which I include a hyperlink column. That link points to
a document whose name is in the "urllink" field in the record for that row.
I know that I can use the following to link to the appropriate document:

DataNavigateUrlFields="urllink"

But how do I code that if I want to put all the documents in a "docs"
subdirectory?



Wayne
 
H

Holysmoke

Hi,

If I understood ur question correctly,

This should work fine,

In itemdatabound event of your datagrid

CType(e.Item.Cells(0).Controls(1),
HyperLink).NavigateUrl = String.Format("frmviewsplit.aspx?id={0}&pr={1}",
oSplit.NumeroRichiesta, oSplit.ProgressivoNumero)

Where cell(0) is your hyperlink column.

HTH,
Holy
 

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
474,139
Messages
2,570,805
Members
47,356
Latest member
Tommyhotly

Latest Threads

Top