Home All Groups Group Topic Archive Search About

Setting Hyperlink URL in Gridview

Author
28 Dec 2005 1:48 PM
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

Author
28 Dec 2005 3:56 PM
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



Show quoteHide quote
"Wayne Wengert" wrote:

> 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
>
>
>