Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
plz tell me the solution for this:
i want to use link on the column item in gridview .the data in that column item is retreived from database and whenever i clicked on particular column item it will navigate to its particular url page and every item in column should navigate to its different pages.
Posted
Comments
vijay__p 3-Jun-13 5:26am    
http://www.codeproject.com/Questions/143724/how-to-add-Hyperlink-in-gridview-in-ASP-NET

Try something like this:
ASP.NET
<asp:hyperlink xmlns:asp="#unknown">
ID="HyperLink2" 
runat="server" 
Font-Bold="True" 
ForeColor="Red" 
Text='<%# Eval("Title", "{0}") %>' 
NavigateUrl='<%# "~/Default.aspx?id=" & Container.DataItem("TitleID") %>' 
Width="306px">
</asp:hyperlink>


Also check out similar threads here[^] & here[^]
 
Share this answer
 
 
Share this answer
 
 
Share this answer
 
XML
<Columns>
                <asp:HyperLinkField DataTextField="LeadID" DataNavigateUrlFields="LeadID" DataNavigateUrlFormatString="LeadInformation.aspx?LeadID={0}" Text="Lead ID" />
                <asp:BoundField DataField="DateTime" HeaderText="Date Updated" />
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Bind("LeadID") + Request.QueryString("type") %>'
                            Text=""></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
</Columns>




Also For more details you can refer the below link:
how to add Hyperlink in gridview in ASP.NET[^]
 
Share this answer
 
Comments
Vibha Singh 3-Jun-13 6:39am    
thnks.. bt may be i m not able to explain that what i want actully....i retrive data in datatable from data base (menuname,formname page link)
i want to display that in gridview every menu and its information and link to the page of each menu
Vibha Singh 3-Jun-13 6:40am    
plz tell me the solution for above.

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