473,780 Members | 2,258 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asp:ImageButton Question

Hello,

I have 2 Asp:ImageButton in my .aspx file and I have the function "Run"
in m .aspx.vb file. I need to run this function when one of the
ImageButtons is pressed but I need to know which one was pressed.

How can I do this?

I was trying with commandname and oncommand properties of
ASP:ImageButton but I was not able to make this work.

Can someone tell me how the code line would look in an ImageButton and
in my function:

Sub Run(???) ???
....

Thank You,
Miguel

Nov 19 '05 #1
1 1281

Sub Run (sender as Object, argument as ImageClickEvent Args) Handles
Button1.Click, Button2.Click
dim button as ImageButton = ctype(sender, ImageButton)
if button.Id = "Button1" then

End Sub

or you could use the commandArgument at that point..

if ctype(sender, ImageButton).Co mmandArgument = "SomeArg" then
something like that should work.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Shapper" <mdmoura*NOSPAM *@gmail.*DELETE 2SEND*com> wrote in message
news:eo******** ******@TK2MSFTN GP14.phx.gbl...
Hello,

I have 2 Asp:ImageButton in my .aspx file and I have the function "Run" in
m .aspx.vb file. I need to run this function when one of the ImageButtons
is pressed but I need to know which one was pressed.

How can I do this?

I was trying with commandname and oncommand properties of ASP:ImageButton
but I was not able to make this work.

Can someone tell me how the code line would look in an ImageButton and in
my function:

Sub Run(???) ???
...

Thank You,
Miguel

Nov 19 '05 #2

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

Similar topics

7
3473
by: nicole | last post by:
We have completed a clean install of Microsoft Server 2003 on our Web Server and are using frontpage 2002 for our web site. On our asp page (www.dgf.k12.mn.us/contactus.asp) we are getting the following error: Database Results Error Description: Syntax error in query. Incomplete query clause. Number: -2147217900 (0x80040E14) Source: Microsoft JET Database Engine
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'"
1
3045
by: JIM | last post by:
Hello, Does anyone knows how to set the visible property of an asp:Imagebutton to true with javascript I've the following declared : <asp:ImageButton Id="tstImage" runat="server" visible="False" />
1
2368
by: Michael Evanchik | last post by:
The following tag works fine in internet explorer, but in mozilla the image is not sized and left at its actualy size. Anyone know why? I though asp.net works on any browswer. <asp:imagebutton id="Image1" Runat="server" onclick="enteraccount" height="90" width="120" ImageUrl="images/account.gif" />
3
5163
by: JIM | last post by:
Hello, I've an asp:Imagebutton on my form with the visible property set to false <asp:Imagebutton ID="tstImage" runat=Server visible=False> How can I set the visible propery to true using a javascript ? I tried something like document.GetElementById('ImgTest').visible='true'; but without succes ....
3
1740
by: thechaosengine | last post by:
Hi all, I need to be able to cause the following chain of events after clicking an asp:button but I don't know how to do it. I'd really appreciate any advice on this or alternative approaches: The window in question is a popup asking the user to provide some details. The primary window is still open in the background 1. Button on popup clicked
5
1719
by: Alex D. | last post by:
Does any body knows how to link an asp:textbox to an asp:imagebutton, both inside a User Control in asp.net 2 beta 2? So when a user enter some text in the textbox and press the "Enter" key the corresponding button click event is launched? Tnx.
13
7449
by: tperri | last post by:
I have an HTML table with several fields like this: <A href="Savings.aspx?category=Food"><asp:imagebutton id="imgFood" ImageUrl="images\buttons\btn-food-i.gif" runat="server"></asp:imagebutton></A> When the user sees these buttons, they will currently be on the savings.aspx?category=whatever page, and when they click another button to look at other categories, all the links I have around these buttons direct to their various categories.
0
9636
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9474
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
10306
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
7485
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
6727
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5504
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
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
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.