473,320 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

C# linkbutton question object does not contain a definition for CommandArgument

I have some VB.NET code that I am trying to convert. I'm not sure what
to do here and was hoping you could help.

Sub PagerButtonClick(sender As Object, e As EventArgs)
'used by external paging UI
Dim arg As String = sender.CommandArgument

is the code from:

http://www.4guysfromrolla.com/webtech/082901-1.2.shtml

I have tried this code in c# (converted as best I could) but I cannot
get the sender.CommandArgument to work.

It's just a button that calls a function on the server side. This
signature:

object sender, System.EventArgs e

does not have an CommandArgument.

I tried a cast like:

(System.Web.UI.WebControls.DataGridCommandEventArg s) sender, but it has
no effect.

I don't know what to do. Thank you for any help. How can I access the
command argument of a button that is not in the datagrid?

Nov 19 '05 #1
2 4927
CommandArgument should come from EventArgs rather than from Object. Try

Dim arg As String = e.CommandArgument

HTH

<ne***********@gmail.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
I have some VB.NET code that I am trying to convert. I'm not sure what
to do here and was hoping you could help.

Sub PagerButtonClick(sender As Object, e As EventArgs)
'used by external paging UI
Dim arg As String = sender.CommandArgument

is the code from:

http://www.4guysfromrolla.com/webtech/082901-1.2.shtml

I have tried this code in c# (converted as best I could) but I cannot
get the sender.CommandArgument to work.

It's just a button that calls a function on the server side. This
signature:

object sender, System.EventArgs e

does not have an CommandArgument.

I tried a cast like:

(System.Web.UI.WebControls.DataGridCommandEventArg s) sender, but it has
no effect.

I don't know what to do. Thank you for any help. How can I access the
command argument of a button that is not in the datagrid?

Nov 19 '05 #2
I won't work as EventArgs or sender. There is no CommandArgument for
object or System.EventArgs. The VB Code allows it, but not the C# code.

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Fresh Air Rider | last post by:
Hello Could anyone please explain how I can pass more than one arguement/parameter value to a function using <asp:linkbutton> or is this a major shortfall of the language ? Consider the...
5
by: Fresh Air Rider | last post by:
Hello Could anyone please explain how I can pass more than one arguement/parameter value to a function using <asp:linkbutton> or is this a major shortfall of the language ? Consider the...
1
by: Sandy | last post by:
I have a repeater which shows Group names. (Skip this part if you want rather irrelevant) The groups are ordered and formatted: Parent ---Child ------Grand Child (okay start reading again...
2
by: News | last post by:
Hi, I need help with datalist and linkbutton. I need a LinkButton to display in datalist if datafield "is_measure_customchecklist" in a db table set to true. Here is the code (in parts): ...
0
by: Solomon Shaffer | last post by:
This is very interesting - and odd. I have a number of LinkButtons that are created in a custom data grid that I created. The purpose of the LinkButtons is to provide alphabetical filtering...
4
by: Tim::.. | last post by:
Can someone tell me how I do a response.redirect using a linkbutton in a datagrid! I want to use the record id in a database to send a querystring to an HTML editor so that users are able to...
6
by: Shivakumar | last post by:
Hi all, Recently i have updated my vs.net 2003 project to vs.net 2005 and i have successfully converted my code and found no problem with all my controls except the one which is the linkbutton. ...
4
by: News | last post by:
Hi, I need help with datalist and linkbutton. I need a LinkButton to be visible in datalist only on the condition when datafield "is_measure_customchecklist" in a db table set to true. Here...
5
by: =?Utf-8?B?TWFyYyBXb29sZnNvbg==?= | last post by:
Hi, I have a strange issue occurring with LinkButtons that are dynamically added to each (data) row of my DataGrid on that grid's ItemDataBound event. Each LinkButton is assigned its own event...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.