databound and hyperlink field needed in gridview

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

PeterKellner

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
 

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,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top