Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
I am displaying a grid view as shown below. Now i want Id to be bound with name field so that i when i click name link it will display details of the employees.
 

Name Address Age
 
ABC sdsd 45
XYZ asdsd 34
 

When i click on ABC or XYZ i must display details. So inorder to do that i must bind (id) on the Name column..How can i do that???
Posted 28-Nov-12 4:33am
Comments
Krunal R at 28-Nov-12 10:36am
   
Make name field as Hyperlink
Arjun Menon U.K at 28-Nov-12 10:39am
   
Can u elaborate?? This is the current code i am using

<asp:TemplateField HeaderText="Name">

<asp:LinkButton ID="lnkName" runat="server" Text='<%# Eval("name")%>' >


<asp:TemplateField HeaderText="Address">

<asp:Label ID="lblAge" runat="server" Text='<%# Eval("age")%>'>


<asp:TemplateField HeaderText="Age">

<asp:Label ID="lblAddress" runat="server" Text='<%# Eval("address")%>'>


Krunal R at 28-Nov-12 10:40am
   
I have provided some links below.. Perhaps that will help you..

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
Arjun Menon U.K at 28-Nov-12 10:43am
   
Thanks a lot Krunal

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

  Print Answers RSS
0 OriginalGriff 428
1 Sergey Alexandrovich Kryukov 253
2 PhilLenoir 115
3 RajeeshMenoth 110
4 Peter Leow 100
0 Sergey Alexandrovich Kryukov 6,465
1 OriginalGriff 5,926
2 CPallini 2,473
3 Richard MacCutchan 1,687
4 Abhinav S 1,540


Advertise | Privacy | Mobile
Web03 | 2.8.140821.2 | Last Updated 28 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100