473,804 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ImageButtonComm andHandler( sender As Object, e As
CommandEventArg s )
Session("Id") = e.CommandArgume nt
end sub

<asp:ImageButto n CommandName="ed it" CommandArgument ='<%#
objReader("Rapp elID") %>' ID="cmdEdit" AlternateText=" Modifier/Edit"
ImageUrl="../images/edit.gif" runat="server"
onCommand="Imag eButtonCommandH andler" />

e.CommandArgume nt is always empty

Can you help me please?
Nov 18 '05 #1
1 2442
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.c om...
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 ImageButtonComm andHandler( sender As Object, e As
CommandEventArg s )
Session("Id") = e.CommandArgume nt
end sub

<asp:ImageButto n CommandName="ed it" CommandArgument ='<%#
objReader("Rapp elID") %>' ID="cmdEdit" AlternateText=" Modifier/Edit"
ImageUrl="../images/edit.gif" runat="server"
onCommand="Imag eButtonCommandH andler" />

e.CommandArgume nt 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
14958
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) { document.images.src = eval("mt" +menu+ ".src") } alert("imgOff_hidemenu"); hideMenu=setTimeout('Hide(menu,num)',500);
1
3299
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."+ JR.Core.Data.JobseekerData.FLD_SEARCH_ID) %>_<%# DataBinder.Eval(Container,"DataItem."+JR.Core.Data.JobseekerData.FLD_SEARCH_ PROFILE_ID ) %>' CommandName='ProfileMatch' id="match" onmouseover="this.src ='../Images/magnifyover.gif'"
0
1113
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 been struggling with this for a while now. Any help would be really appreciated! See the code below. The error I get is "The best overloaded method match for OnDelete(long)' has some invalid arguments"
0
1564
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 know the syntax to databind the commandargument to the row through code. I am assumning I use the DataBinder.Eval method but I cannot get it going. Below is the code sample. Thanks Solomon public class KnowlagentDataGridTemplate : ITemplate
1
1924
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 the database; and 3. create another bunch of link buttons. All on the same page. Can anybody suggest how I do step 1 ?
1
4611
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 acting as if I did not set it). Here is my code that sets the CommandArgument property in the ItemDataBound event: CType(e.Item.FindControl("btnMainMoveDown"), Button).CommandArgument = CStr(CType(Me.datMain.DataSource,...
1
13310
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 ImageButton I needed to redirect the user to the Edit page where the data on the page would be prepopulated with data from the database. I tried several things without success then discovered that the CommandArgument property could be used for this...
2
1116
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"> <ItemTemplate> <asp:Button ID="btnOggi" runat="Server" CommandArgument='<%# Eval("ID") %>' OnClick="gwDettaglio_Click" Text='<%# Eval("ID") %>' Width="60px" />
4
3018
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 the record. Those interface elements are a Button and a TextBox. The idea is that the administrator using the interface will fill in an e-mail address and press the button if they want to send that particular record to someone by e-mail. (I know...
0
9577
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10569
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10315
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9140
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.