473,513 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Imagebutton OnClientClick event don't raise on ie mobile

1 New Member
Hi,

I try to raise a javascript function with the imagebutton onclientclick event but it doesn't raise on my emulator which has ie mobile 6.12.The imageButton do postback instead of calling the client function. this code works fine on my desktop. If i try to do the same thing whith a button it works fine on the emulator. How can I raise the javascript function from the imagebutton ?
Here a simple code to show the problem :
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="NativEnr.Mobile.Test" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml" >
  6. <head runat="server">
  7.     <title></title>    
  8.     <script type="text/javascript">
  9.         function test() {
  10.             alert('Hello1');
  11.             return false;
  12.         }
  13.     </script>
  14. </head>
  15. <body>
  16.     <form id="form1" runat="server">
  17.     <div>          
  18.         <asp:ImageButton ID="img1" runat="server" ImageUrl="~/Images/Buttons/btnSend.jpg" OnClientClick="return test()" />                       
  19.         <asp:Button ID="btnTest" runat="server"   OnClientClick="return test()"  />  
  20.     </div>
  21.     </form>
  22. </body>
  23. </html>
  24.  
  25.  
Mar 17 '10 #1
1 2254
markmcgookin
648 Recognized Expert Contributor
That's probably because that functionality isn't supported on the mobile device.
Mar 17 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2480
by: DalePres | last post by:
Does anyone know if there is a known bug or workaround, or other solution to this problem? I have a page with several imagebutton server controls and needed to handle the PreRender event in C#....
2
4003
by: Oney | last post by:
I want to open a popup window when user click the web server button control When user click the button, only OnClik="OpenWindow(12)" is sent but no event happend no popup opened.After...
3
2790
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...
3
3311
by: sck10 | last post by:
Hello, When a person subits my web page, I do a simple check (validation) and if there are any errors, I create a variable (strValidateText) and set that value to a label on the form. What I...
0
1125
by: Mick | last post by:
Hi (again ^^) In my ItemDataBound function, I dynamically create an ImageButton. I add to it an onclick event. Anyway, when clicking my imagebutton, I don't raise the onclick event ! Any help...
13
7411
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"...
0
1486
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...
0
976
by: LacOniC | last post by:
I use an ImageButton Field in DetailsView. I can't open photo (to view in original size) in a new window with below code. No error, i click and do nothing. Any advice? <ItemTemplate> ...
0
3800
by: jtencate | last post by:
I am trying to add an OnClientClick event to links in an asp:Menu. I tried using a StaticItemTemplate to bind the MenuItem data to a LinkButton with an OnClientClick attribute. This works fine to...
7
18721
by: =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ== | last post by:
I am having trouble getting client-side events to fire on ImageButtons. Instead I am seeing postbacks. The client-side handlers end with "return false;" but they are never called. ...
0
7257
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
7157
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
7379
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,...
1
7098
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...
0
7521
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...
0
5682
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,...
0
4745
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...
0
3232
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...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.