See the documentation for LinkButton.CommandArgument Property. It gives an example of what I think you're looking for. If it's not clear, just send a follow-up.
--- Patrick Steele ([EMAIL PROTECTED]) Lead Software Architect Image Process Design -----Original Message----- From: Matthew Small [mailto:[EMAIL PROTECTED]] Sent: Monday, September 23, 2002 12:51 PM To: dotnet Subject: RE: Dynamically creating LinkButton and getting error SelectItem is a subroutine that I call. I'm not really confident of how OnCommand works. I thought it was like OnClick except it passes parameters. What I need to do is have a linkbutton that, when clicked, calls SelectItem(CategoryId as String) or some variation of the function that will let me determine which link was clicked. Matthew Small IT Supervisor Showstopper National Dance Competitions 3660 Old Kings Hwy Murrells Inlet, SC 29576 843-357-1847 http://www.showstopperonline.com -----Original Message----- From: Patrick Steele [mailto:[EMAIL PROTECTED]] Sent: Monday, September 23, 2002 12:45 PM To: dotnet Subject: RE: Dynamically creating LinkButton and getting error I guess I'd need to know exactly what you want with this statement: Link.OnCommand="SelectItem" Do you have a function or sub called "SelectItem" that you want to be called whenever the Command event fires? Or are you trying to set up some client-side javascript stuff for that control? --- Patrick Steele ([EMAIL PROTECTED]) Lead Software Architect Image Process Design -----Original Message----- From: Matthew Small [mailto:[EMAIL PROTECTED]] Sent: Monday, September 23, 2002 12:37 PM To: dotnet Subject: RE: Dynamically creating LinkButton and getting error Can you break that down for me? Matthew Small IT Supervisor Showstopper National Dance Competitions 3660 Old Kings Hwy Murrells Inlet, SC 29576 843-357-1847 http://www.showstopperonline.com -----Original Message----- From: Patrick Steele [mailto:[EMAIL PROTECTED]] Sent: Monday, September 23, 2002 12:29 PM To: dotnet Subject: RE: Dynamically creating LinkButton and getting error Assuming the "SelectItem" is a VB.NET procedure on the server, you should use: AddHandler Link.Command, AddressOf SelectItem --- Patrick Steele ([EMAIL PROTECTED]) Lead Software Architect Image Process Design -----Original Message----- From: Matthew Small [mailto:[EMAIL PROTECTED]] Sent: Monday, September 23, 2002 12:19 PM To: dotnet Subject: Dynamically creating LinkButton and getting error Hi - I am dynamically creating a linkbutton. When I run the page, I get an error that I do not understand. Can you help me please? Code: Dim Link as LinkButton ... Link = new LinkButton Link.Text = dbrow.item("categoryname") Link.CommandName = "CatId" Link.CommandArgument = dbrow.item("categoryid") Link.OnCommand="SelectItem" ... Error: Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30390: 'System.Web.UI.WebControls.LinkButton.Protected Overridable Overloads Sub OnCommand(e As System.Web.UI.WebControls.CommandEventArgs)' is not accessible in this context because it is 'Protected'. Source Error: Line 91: Link.CommandName = "CatId" Line 92: Link.CommandArgument = dbrow.item("categoryid") Line 93: Link.OnCommand="SelectItem" Line 94: Line 95: Cell = new TableCell Source File: C:\Inetpub\asp.office\shoponline\cart.aspx Line: 93 Thank you for you help. Matthew Small IT Supervisor Showstopper National Dance Competitions 3660 Old Kings Hwy Murrells Inlet, SC 29576 843-357-1847 http://www.showstopperonline.com -----Original Message----- From: Thomas V. Nielsen [mailto:[EMAIL PROTECTED]] Sent: Monday, September 23, 2002 10:56 AM To: dotnet Subject: RE: Finding Image Height/Width with VBScript? Hmm how about setting it to 100% ? <Thomas/> --- You are currently subscribed to dotnet as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --------- Administrated by 15 Seconds : http://www.15Seconds.com List Archives/Search : http://local.15Seconds.com/search Subscription Information : http://www.15seconds.com/listserv.htm Advertising Information: http://www.internet.com/mediakit/ --- You are currently subscribed to dotnet as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --------- Administrated by 15 Seconds : http://www.15Seconds.com List Archives/Search : http://local.15Seconds.com/search Subscription Information : http://www.15seconds.com/listserv.htm Advertising Information: http://www.internet.com/mediakit/ --- You are currently subscribed to dotnet as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --------- Administrated by 15 Seconds : http://www.15Seconds.com List Archives/Search : http://local.15Seconds.com/search Subscription Information : http://www.15seconds.com/listserv.htm Advertising Information: http://www.internet.com/mediakit/ --- You are currently subscribed to dotnet as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --------- Administrated by 15 Seconds : http://www.15Seconds.com List Archives/Search : http://local.15Seconds.com/search Subscription Information : http://www.15seconds.com/listserv.htm Advertising Information: http://www.internet.com/mediakit/ --- You are currently subscribed to dotnet as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --------- Administrated by 15 Seconds : http://www.15Seconds.com List Archives/Search : http://local.15Seconds.com/search Subscription Information : http://www.15seconds.com/listserv.htm Advertising Information: http://www.internet.com/mediakit/ --- You are currently subscribed to dotnet as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% --------- Administrated by 15 Seconds : http://www.15Seconds.com List Archives/Search : http://local.15Seconds.com/search Subscription Information : http://www.15seconds.com/listserv.htm Advertising Information: http://www.internet.com/mediakit/ --- You are currently subscribed to dotnet as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] --------- Administrated by 15 Seconds : http://www.15Seconds.com List Archives/Search : http://local.15Seconds.com/search Subscription Information : http://www.15seconds.com/listserv.htm Advertising Information: http://www.internet.com/mediakit/
