databound and hyperlink field needed in gridview

  • Thread starter Thread starter Carlos
  • Start date Start date
C

Carlos

Hi all,

I need a field that it is both databound, and hyperlink in a gridview. That
is, the value is obtained from a query, and at the same time needs to point
to a new page where
will be used to make another query. How can this be possible in asp .net?

Thanks in advance,

Carlos.
 
Hi all,

I need a field that it is both databound, and hyperlink in a gridview. That
is, the value is obtained from a query, and at the same time needs to point
to a new page where
will be used to make another query. How can this be possible in asp .net?

Thanks in advance,

Carlos.

Hi Carlos,

I'd suggest adding another column to your gridview of type
TemplateField. It would look something like what is below. id is a
column in my database table referenced in gridview's datasource.

....
<asp:BoundField DataField="aka" HeaderText="aka"
SortExpression="aka" />
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HyperLink1"
NavigateUrl='<%#
"http://peterkellner.net/downloads?id=" + Eval("id") %>'
runat= "server">GO TO
PETERKELLNER>NET</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>


Peter Kellner
http://peterkellner.net
 
Back
Top