Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 26th, 2007, 01:16 AM
Authorized User
 
Join Date: Aug 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to Access DataKeyField from DataList in C#

friendzz
i have a LinkButton in a DataList and on its click in want to get
"TopicId" which is place in DataKeyField attribute

Can any one will help me, that how can i get the value of TopicId for that ItemTemplate on click on LinkButton
__________________
Software Programmer (ASP.NET),
Mumbai,
India.
 
Old October 26th, 2007, 01:51 AM
Authorized User
 
Join Date: Aug 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

foreach (DataKey key in gvPendingCalls.DataKeys)
            {
                str1 = key[0].ToString();
                str2 = key[1].ToString();
                str3 = key[2].ToString();
                str4 = key[3].ToString();
                str5= key[4].ToString();
                str6 = key[5].ToString();
                str6 = key[6].ToString();
            }

Thanks,
Viji.S






Similar Threads
Thread Thread Starter Forum Replies Last Post
DataKey / DataKeyField / DataKeyNames rsearing ASP.NET 2.0 Basics 0 June 30th, 2008 08:25 PM
access information from a datalist System.Web.UI.I kristian1977 ASP.NET 2.0 Basics 0 July 21st, 2006 08:28 AM
How to add 2 cols in DataGrid1.DataKeyField drasko ADO.NET 8 May 4th, 2005 02:09 AM
How to add 2 columns in DataGrid.DataKeyField drasko ASP.NET 1.0 and 1.1 Professional 4 September 17th, 2004 09:05 AM
DataGrids and DataKeyField booksnore2 Classic ASP Basics 2 July 5th, 2004 08:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.