473,569 Members | 2,764 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ImageButton Click Event

Why does the click event of an image button that submitts a form does not
get fired when ENTER is pressend on a textbox of that form? How can I make
this happen?

Thanks
Nov 19 '05 #1
3 7061
> Why does the click event of an image button that submitts a form does not
get fired when ENTER is pressend on a textbox of that form?
Okay, let's imagine that you have a form with 2 submit buttons, an an image
button (yes, this is possible). Which event handler should be called when
you press ENTER to submit the form?
How can I make this happen?
What you need to do is capture the ENTER key, and use JavaScript to click
the Image Button programmaticall y. If you don't know how to capture the
ENTER keypress event, Google it. Here's a start for you:

http://www.google.com/search?hl=en&q...ture+ENTER+Key

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"TCORDON" <tc******@hotma il.com> wrote in message
news:ux******** ******@TK2MSFTN GP14.phx.gbl... Why does the click event of an image button that submitts a form does not
get fired when ENTER is pressend on a textbox of that form? How can I make
this happen?

Thanks

Nov 19 '05 #2
I have two different web pages...one has 2 textboxes (Username and Pwd) and
an Image button, in this webpage if the user enters his username and pwd and
hits enter, the ImageButton's click event is fired. In the other WebPage I
just have a Textbox and an imageButton, vut in this one if the user fills
the textbox and then hits Enter the form is just posted back, the click
event of the imagebutton doesn´t fire, why can this be?

Thanks Again
"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:uV******** ******@TK2MSFTN GP14.phx.gbl...
Why does the click event of an image button that submitts a form does not
get fired when ENTER is pressend on a textbox of that form?


Okay, let's imagine that you have a form with 2 submit buttons, an an
image button (yes, this is possible). Which event handler should be called
when you press ENTER to submit the form?
How can I make this happen?


What you need to do is capture the ENTER key, and use JavaScript to click
the Image Button programmaticall y. If you don't know how to capture the
ENTER keypress event, Google it. Here's a start for you:

http://www.google.com/search?hl=en&q...ture+ENTER+Key

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.

"TCORDON" <tc******@hotma il.com> wrote in message
news:ux******** ******@TK2MSFTN GP14.phx.gbl...
Why does the click event of an image button that submitts a form does not
get fired when ENTER is pressend on a textbox of that form? How can I
make this happen?

Thanks


Nov 19 '05 #3
The Great Karnak is having trouble seeing your source code.

--
;-),

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"TCORDON" <tc******@hotma il.com> wrote in message
news:eN******** *******@TK2MSFT NGP12.phx.gbl.. .
I have two different web pages...one has 2 textboxes (Username and Pwd) and
an Image button, in this webpage if the user enters his username and pwd
and hits enter, the ImageButton's click event is fired. In the other
WebPage I just have a Textbox and an imageButton, vut in this one if the
user fills the textbox and then hits Enter the form is just posted back,
the click event of the imagebutton doesn´t fire, why can this be?

Thanks Again
"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:uV******** ******@TK2MSFTN GP14.phx.gbl...
Why does the click event of an image button that submitts a form does
not get fired when ENTER is pressend on a textbox of that form?


Okay, let's imagine that you have a form with 2 submit buttons, an an
image button (yes, this is possible). Which event handler should be
called when you press ENTER to submit the form?
How can I make this happen?


What you need to do is capture the ENTER key, and use JavaScript to click
the Image Button programmaticall y. If you don't know how to capture the
ENTER keypress event, Google it. Here's a start for you:

http://www.google.com/search?hl=en&q...ture+ENTER+Key

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.

"TCORDON" <tc******@hotma il.com> wrote in message
news:ux******** ******@TK2MSFTN GP14.phx.gbl...
Why does the click event of an image button that submitts a form does
not get fired when ENTER is pressend on a textbox of that form? How can
I make this happen?

Thanks



Nov 19 '05 #4

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

Similar topics

0
1800
by: Mark | last post by:
Hi, I am trying to capture the click event of an ImageButton that exists in a composite server control that I am building. I create the imagebutton in the CreateChildControls routine ' Create the button Dim imgButton as New ImageButton ' Add click event handler AddHandler imgButton.Click, AddressOf OnSend
5
6164
by: J McD | last post by:
Hi I have a DataGrid with an ImageButton column. When I click on an imagebutton I get a postback but it doesn't run the OnImgBtnClick method. I can actually comment out the line where I add this Click event to the ImageButton Column and it makes no difference, I still get a postback. This is driving me crazy...something seems to be causing...
1
3335
by: Henke | last post by:
Hello, I have one ImageButton controls which I initialize in Page_Load and declare on class level. ImageButton save = new ImageButton(); save.ImageUrl = "save.gif" save.Click += new ImageClickEventHandler(this.save_click); This ImageButton is added to a dynamic table which is also
4
1865
by: angus | last post by:
Dear all, I know that i can add a button with oncommand event "ImageButton_Command" by using the asp:ImageButton tag in the aspx code. <asp:ImageButton id="imagebutton1" runat="server" AlternateText="Sort Ascending" ImageUrl="images/pict.jpg" OnCommand="ImageButton_Command" CommandName="Sort"
3
2794
by: Benjamin Gavin | last post by:
Hi all, I recently stumbled upon a bug in the ASP.NET framework handling of ImageButton based postbacks. The issues derives from the fact that IE and Mozilla handle the case of a missing image file differently. In both cases, the setup for the problem is: 1. Create a form with an ImageButton whose ImageURL is invalid, specify an...
3
6293
by: tshad | last post by:
I was trying to change my asp:button to asp:ImageButton, but got a message saying that ImageButton does not have an onClick function. How do I get the ImageButton call a function? Thanks, Tom.
13
7419
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...
0
1493
by: Oddball | last post by:
I have set up a page with uses two lots of image buttons, one for a collection and one for more images from that collection. I generate all the image buttons on page init (I know, but I implemented that as part of trying to solve this already existant problem). The CollectionItemButton_Click event will fire, but the MoreImagesButton_Click...
1
1494
by: serge calderara | last post by:
Dear all, I gave a datagrid object wich has a template column define as follow : <asp:TemplateColumn HeaderText="Evt"> <ItemTemplate> <asp:ImageButton id="ImageButton2" ImageAlign=Middle runat="server" ImageUrl="event.gif" CommandName="ShowEvent" CommandArgument ='<%#DataBinder.Eval(Container,"DataItem.ID")%>' > </asp:ImageButton>
0
7693
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...
0
7605
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...
0
7917
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. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7665
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...
0
7962
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
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...
1
2105
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
0
933
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...

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.