How to add an hyperlick column to grid view

V

Valli

Hi,

I am using a gridview to display data from table. In the gridview, there
are 5 columns in which one column contains link name(eg.
http://www.msn.com).
I want to show this link as an hyperlink & when the user click the link,
the browser should open the link page.
Can anyone explain how to add an hyperlink column & when it got clicked
it should get transferered to the selected web page.
The link page differs for each record in grid view.

I am new to ASP. Please help me in this...

Regards
Valli
 
M

Michael Nemtsev, MVP

Hello Valli,

Just add a hyperlink control. You can edit the standard gridview template
http://authors.aspalliance.com/aspxtreme/webforms/controls/addinghyperlinkfieldstogridview.aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


V> Hi,
V>
V> I am using a gridview to display data from table. In the
V> gridview, there
V> are 5 columns in which one column contains link name(eg.
V> http://www.msn.com).
V> I want to show this link as an hyperlink & when the user click
V> the link,
V> the browser should open the link page.
V> Can anyone explain how to add an hyperlink column & when it got
V> clicked
V> it should get transferered to the selected web page.
V> The link page differs for each record in grid view.
V> I am new to ASP. Please help me in this...
V>
V> Regards
V> Valli
 
G

Guest

You can add a TemplateField in the GridView control using the Edit Column
option from the context menu when you click on the smart tag (arrow on top og
the Grid).

1. Add a TemplateField in the Selected Fields list.

2. Now Right click on the Grid and select Edit Templates. Now drop the
Hyperlink control in the ItemTemplate of the Grid.

3. Now bind the NavigateURL and Text property of the Hyperlink to the
hyperlink column field in the table using Data Bindings.

4. Now if you click on the hyperlink, it will take you to that page.

Regards,
Manish
 

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,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top