hyperlink in gridview

Discussion in 'ASP .Net' started by Mike P, Aug 9, 2006.

  1. Mike P

    Mike P Guest

    I have a template field I want to use as a hyperlink. How do I do this?

    <asp:TemplateField HeaderText="Company" SortExpression="Name">
    <ItemTemplate>
    <asp:Label ID="lblCompany" Text='<%#
    Eval("Name") %>' runat="server"></asp:Label>
    </ItemTemplate>
    <ItemStyle Height="24px" Width="100px"
    />
    </asp:TemplateField>

    *** Sent via Developersdex http://www.developersdex.com ***
     
    Mike P, Aug 9, 2006
    #1
    1. Advertising

  2. Mike P

    Ray Booysen Guest

    Change the Label in the template to a hyperlink control.

    Regards
    Ray

    Mike P wrote:
    > I have a template field I want to use as a hyperlink. How do I do this?
    >
    > <asp:TemplateField HeaderText="Company" SortExpression="Name">
    > <ItemTemplate>
    > <asp:Label ID="lblCompany" Text='<%#
    > Eval("Name") %>' runat="server"></asp:Label>
    > </ItemTemplate>
    > <ItemStyle Height="24px" Width="100px"
    > />
    > </asp:TemplateField>
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
     
    Ray Booysen, Aug 9, 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. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    18,046
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  2. davetichenor
    Replies:
    1
    Views:
    915
    Eliyahu Goldin
    Oct 30, 2006
  3. Keith G Hicks
    Replies:
    3
    Views:
    810
    Keith G Hicks
    Feb 18, 2008
  4. Ken
    Replies:
    1
    Views:
    434
    Alvin Bruney
    Aug 16, 2003
  5. Dave
    Replies:
    0
    Views:
    1,003
Loading...

Share This Page