Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 April 28th, 2004, 08:31 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default Data Grid TemplateColumn

Hello,

I have a drop-down list and linkbutton in a data grid control. How do I specify an event handler in this template column for the link button?

Thanks,

Brian Mains
__________________
Brian
 
Old May 1st, 2004, 07:12 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You should be able to just put the event handler name into the link button "onClick" event attribute:

<asp:linkbutton runat="server" OnClick="yourHandlerName" />
 
Old May 5th, 2004, 10:26 AM
Authorized User
 
Join Date: May 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you need to worry about the fact that OnClick is client side as well as server side. I know there is a way to code around the problem, but don't know what it is. Sorry.

Chris

 
Old May 5th, 2004, 10:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Notice the runat="server"...

Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 
Old May 5th, 2004, 11:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Now that I think about it, I could have used the ItemCreated event to find the control also, but I like the OnClick better.

Thanks for all of the comments.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sort data in a data grid? zaheerabbas.sk ASP.NET 1.0 and 1.1 Basics 3 April 10th, 2007 02:37 PM
Export data from data grid to excel pomoc VB.NET 2002/2003 Basics 0 December 16th, 2005 03:11 PM
Export data from data grid to Excel pomoc Visual Basic 2005 Basics 0 December 16th, 2005 02:56 PM
trying to load db data into data grid itsajourney Beginning VB 6 2 June 7th, 2005 12:05 PM
TemplateColumn - Question vox Classic ASP Professional 1 June 6th, 2005 07:18 AM





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