Imagebutton OnClientClick event don't raise on ie mobile

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OS538DAV
    New Member
    • Mar 2010
    • 1

    Imagebutton OnClientClick event don't raise on ie mobile

    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 :
    Code:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="NativEnr.Mobile.Test" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title></title>    
        <script type="text/javascript">
            function test() {
                alert('Hello1');
                return false;
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>          
            <asp:ImageButton ID="img1" runat="server" ImageUrl="~/Images/Buttons/btnSend.jpg" OnClientClick="return test()" />                       
            <asp:Button ID="btnTest" runat="server"   OnClientClick="return test()"  />  
        </div>
        </form>
    </body>
    </html>
  • markmcgookin
    Recognized Expert Contributor
    • Dec 2006
    • 648

    #2
    That's probably because that functionality isn't supported on the mobile device.

    Comment

    Working...