Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Can you tell me how to add dynamic hyper links in the grid view.

Suppose in my database i have a table called Project in that i have column called projectname.
I want to display ProjectName as a hyper link.

Can u explain how to add Hyperlinks in gridview
Posted
Updated 30-Apr-14 23:55pm

try this :-
XML
<asp:GridView ID="grid1" runat="server" AutoGenerateColumns="false" >
     <Columns>
         <asp:TemplateField HeaderText="ProjectName" >
            <ItemTemplate>
              <asp:HyperLink ID="hLnkProject" runat="server" Text='<%#Eval("ProjectName")
                     %>'></asp:HyperLink>
            </ItemTemplate>
         </asp:TemplateField>
    </Columns>
  </asp:GridView>
 
Share this answer
 
Use this

<asp:templatefield visible="false" xmlns:asp="#unknown">
<itemtemplate>
<asp:label id="lblAutoID" runat="server" text="<%#Eval(" autoid")%&gt;"="">

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900