databound and hyperlink field needed in gridview

Discussion in 'ASP .Net' started by Carlos, Jun 7, 2006.

  1. Carlos

    Carlos Guest

    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.
     
    Carlos, Jun 7, 2006
    #1
    1. Advertising

  2. Carlos

    PeterKellner Guest

    On Wed, 7 Jun 2006 11:00:25 -0400, "Carlos" <>
    wrote:

    >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
     
    PeterKellner, Jun 8, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    694
  2. rodchar
    Replies:
    0
    Views:
    408
    rodchar
    Nov 26, 2007
  3. RJ
    Replies:
    1
    Views:
    181
    JeffP@Work
    Sep 12, 2006
  4. Manu
    Replies:
    0
    Views:
    187
  5. Sound
    Replies:
    2
    Views:
    498
    Randy Webb
    Sep 28, 2006
Loading...

Share This Page