Wrox Programmer Forums
|
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 September 11th, 2006, 01:58 PM
Authorized User
 
Join Date: Sep 2006
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Apologies if this sounds a silly question, but I'm still learning asp.net. Do you mean change sender.CommandArgument to e.CommandArgument ? The reason I ask is that this produces the error BC30456: 'CommandArgument' is not a member of 'System.EventArgs'.

Thanks,

 
Old September 11th, 2006, 02:15 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Sorry I am thinking of an ImageButton not a standard button; What you would actually have to do would be to loop through the datalist control collection, something like this:

        Dim objC As Control
        Dim intI as integer

        For Each objC In dl.Controls
            If TypeOf objC Is Button And objC Is sender Then
                Dim btn As Button = CType(objC, Button)
                intI = btn.CommandArgument
            End If
        Next

This will set intI to the value of the buttons command argument

"The one language all programmers understand is profanity."





Similar Threads
Thread Thread Starter Forum Replies Last Post
Synch 2 access databases raguapk Pro VB 6 2 December 11th, 2007 11:27 PM
Updating databases with VB 2005 Express PatCiferri VB How-To 3 December 3rd, 2007 08:31 AM
MS Access Databases dmoffice VB Databases Basics 1 October 10th, 2006 03:37 PM
Access Databases won't update through code wwwaynes Access ASP 2 October 3rd, 2004 03:33 PM





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