473,395 Members | 1,905 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,395 software developers and data experts.

How to passing parameters in the CommandArgument

Hi,

I need to passing parameters in CommandArgument of the asp:ImageButton.
I don't use datagrid or datalist
Here is my code:

Private Sub ImageButtonCommandHandler( sender As Object, e As
CommandEventArgs )
Session("Id") = e.CommandArgument
end sub

<asp:ImageButton CommandName="edit" CommandArgument='<%#
objReader("RappelID") %>' ID="cmdEdit" AlternateText="Modifier/Edit"
ImageUrl="../images/edit.gif" runat="server"
onCommand="ImageButtonCommandHandler" />

e.CommandArgument is always empty

Can you help me please?
Nov 18 '05 #1
1 2421
The MSDN docs contain an example of setting this on a button:

http://msdn.microsoft.com/library/de...umenttopic.asp
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Gilles T." <gi************@hotmail.com> wrote in message
news:iL**********************@news.easynews.com...
Hi,

I need to passing parameters in CommandArgument of the asp:ImageButton.
I don't use datagrid or datalist
Here is my code:

Private Sub ImageButtonCommandHandler( sender As Object, e As
CommandEventArgs )
Session("Id") = e.CommandArgument
end sub

<asp:ImageButton CommandName="edit" CommandArgument='<%#
objReader("RappelID") %>' ID="cmdEdit" AlternateText="Modifier/Edit"
ImageUrl="../images/edit.gif" runat="server"
onCommand="ImageButtonCommandHandler" />

e.CommandArgument is always empty

Can you help me please?

Nov 18 '05 #2

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

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
1
by: Darren Clark | last post by:
I need to be able to send through 2 peices of infomraiton in the commandArgument property of a image button... <asp:imagebutton CommandArgument='<%# DataBinder.Eval(Container,"DataItem."+...
0
by: WorkGoddammit | last post by:
Hi, I want to create a datagrid with an extra column containing a linkbutton. Clicking on the linkbutton invokes a function and passes a parameter containing the id of the row in question. I've...
0
by: Solomon Shaffer | last post by:
I have a datagrid that I am adding a template column to (containing a couple of linkbuttons) at runtime and am having some difficulty setting the commandargument or the linkbuttons. Does anyone...
1
by: bill tie | last post by:
I create several link buttons based on database data. When a user clicks a link button, 1. I want to pass the value of the button as a parameter to an SQL query string; 2. suck more data out of...
1
by: Nathan Sokalski | last post by:
I am trying to set the CommandArgument property of a Button control from a template in a DataList of mine using code in the ItemDataBound event. However, it does not want to set the property (it is...
1
nateraaaa
by: nateraaaa | last post by:
While working on a recent project I discovered how useful the CommandArgument property can be. I needed to determine the record_id of a row displayed in my datagrid. When the user clicked the Edit...
2
by: mik | last post by:
I've a grid view with a Server Button, I know how to send a single value of the row, but How Can I manage 2 parameters (of the row)?? </asp:BoundField> <asp:TemplateField HeaderText="Scadute">...
4
by: Ken Fine | last post by:
I'm making an administrative interface that lists records in a GridView. For *each* row in the gridview, I would there to be two interface elements in addition to some information associated with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.