Link to home
Start Free TrialLog in
Avatar of pratikshahse
pratikshahse

asked on

hyperlink column in my gridview

I have grid view in which I want the last column to be a hyperlink. and the querystring for that link is the going to be the value of the first column of the gridview.  so the link should be something like
service.aspx?service="whatever the value is from the first column". the text of that hyperlink should be "View". How can I accomplish this?


I am populatating the grid by creating a datatable in my code and then binding the grid with that datatable.
<asp:BoundField DataField="servicename" HeaderText="Service" />
<asp:BoundField DataField="New" HeaderText="New" />
<asp:BoundField DataField="Old_Amount" HeaderText="Old Budget" />
<asp:BoundField DataField="New_Amount" HeaderText="New Budget" />
<asp:BoundField DataField="Difference" HeaderText="Difference" />
<asp:BoundField HeaderText="Notes/Attachments" />
<asp:HyperLinkField Text should be "View" url should be \service.aspx?servicename= value from the first column/>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of OBonio
OBonio
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial