OnClientClick for ImageButton does not work

6 replies. Last post: April 18, 2011 3:07 AM by Wolfgang Pichler
Tags :
  • New Discussion
  • New Question
  • New Product Feedback

Good Day,

A few days ago we upgraded our version of IntersoftWebStudio with all updates.
Because of this update however, the OnClientClick Javascript Event for ImageButton does not work anymore.

If you use "<asp:Image>" with OnClick instead of "<asp:ImageButton>" with OnClientClick, it works.
This problem seems to only occur with ImageButtons.

I've uploaded a testsite for you to look at as an attachment + I added the code in this post as well.

The Intersoft Version we are using:


The ASPX Page:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestImageButton.aspx.cs"
Inherits="Test_Debug_TestImageButton" %>

<%@ Register Assembly="ISNet.WebUI.WebDesktop" Namespace="ISNet.WebUI.WebDesktop"
TagPrefix="ISWebDesktop" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ISWebDesktop:WebFlyPostBackManager ID="uiService" runat="server" ServiceUrl="TestImageButton.aspx"
TimeoutInterval="900" LoaderStyle-BackColor="Black" BlockPageUIOnBusy="true"
EnableUIMode="true">
<FlyPostBackSettings PostControlState="true" PostHiddenFields="true" PostInputControls="true"
PostViewState="true" />
</ISWebDesktop:WebFlyPostBackManager>
<asp:ImageButton ID="ImageButton" runat="server" OnClientClick="alert('Javascript is working!');"
AlternateText="ClickMe" />
</form>
</body>
</html>

The ASPX.cs Page:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ISNet.WebUI;
using ISNet.WebUI.WebDesktop;

public partial class Test_Debug_TestImageButton : System.Web.UI.Page
{
WebFlyPostBackListener listener = null;

protected void Page_Load(object sender, EventArgs e)
{

listener = new WebFlyPostBackListener(this);
}
}

regards,

Wolfgang Pichler
All times are GMT -5. The time now is 7:34 PM.
Previous Next