Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 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
  #1 (permalink)  
Old June 4th, 2008, 08:53 AM
Authorized User
 
Join Date: Dec 2005
Location: , Colorado, USA.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rdove84
Default Use LinkButton to pull record from DataList

I have a DataList that is populated with a selection of records from a SQL server database. Inside each template I have a LinkButton called Update that is meant to extract the ticket number of the entry and then populate another panel with data using that number. I thought I was extracting the correct data using the following two lines of code (below); however, I discovered that this code pulls the ticket number from the first DataList item and not from the Item in which the update button was clicked. Could someone tell me how to retrieve the number from the specific row in which the update button is clicked?

Context.Items["ticketNo"] = ((Label)CdsDataList.Items[0].FindControl("ticketNoLabel")).Text;
string ticketLabel = Context.Items["ticketNo"].ToString();


Thanks in advance.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling a method from Linkbutton in DataList swifty_programmer ASP.NET 2.0 Basics 1 July 28th, 2007 05:32 AM
Pull up or Create Record on Calendar Click Maverick10gk Pro VB Databases 10 April 26th, 2007 02:23 PM
linkbutton Beulah VS.NET 2002/2003 3 October 10th, 2005 05:00 PM
Pull or Push? sureshvb Crystal Reports 0 August 23rd, 2004 01:13 AM
Pull info from 2 tables stacy Classic ASP Databases 6 March 19th, 2004 10:46 AM





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