Error with ICallbackEventHandler and Firefox

T

timor.super

Hi group,

I'm trying to extend the ImageButton webcontrol to add "Ajax"
functionnality. So, my control implements ICallbackEventHandler and
I'm adding the js callback on onclick event :

protected override void OnInit(EventArgs e)
{
string script = ".........my js script ..........";
Page.ClientScript.RegisterClientScriptBlock(GetType(),
"myscript", script, true);
base.OnInit(e);
}

protected override void OnLoad(EventArgs e)
{
string callbackRef =
Page.ClientScript.GetCallbackEventReference(this, "....my param....",
"ClientCallback", "null", true);
Attributes["onclick"] = callbackRef;
base.OnLoad(e);
}

and a classical implementation for RaiseCallbackEvent and
GetCallbackResult

Everything is ok with IE, but it's not working on Firefox.

When I debug with FF, i can step on RaiseCallbackEvent or
GetCallbackResult, but it seems that the js method is never call

After some googling, i found this post : http://forums.asp.net/t/959825.aspx
where joteke tells us that the field seems to do a postback in FF

the generated html for my control is :

<input type="image" ... onclick="WebForm_DoCallback(....);"
style="border-width:0px;" />

So I can see my control generate an input type image. Is this the
problem ?

What should I do to make it working with FF ?

Do someone have any idea ?

Thanks for your help.

T.
 
B

bruce barker

you do not cancel the default image postback. change code to:

Attributes["onclick"] = callbackRef + ";return false;";


-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top