stop button postback ajax in non-ie

G

gerry

Sung the ASP.NET AJAX framework, and following the control creation examples
from the ajax toolkit I have created a simple custom control that includes a
button with a client side onClick handler.
Returning false from the handler prevents postbacks in IE but in firefox the
handler fires and does its thing but the postback still occurs as well.
I read that changing this from an INPUT SUMIT to a BUTTON would fix this
problem, however that to me is a problem as it always prevents postbacks. I
would still want postbacks to occur in the case where scripting is turned
off or not supported.

If I add an asp:Button to the page and set the
OnClientClick="alert('hi');return false;" the postback is suppressed in all
browsers as it should be - so I assume that the problem is buried somewhere
in the ajax framework.

Any suggestions ?

Gerry
 
W

Walter Wang [MSFT]

Hi Gerry,

I'm not very sure about your question, is it related to AJAX Control
Toolkit or you're just creating a simple ScriptControl?

Could you please post the complete code that could help to reproduce the
issue? Also, what's the version of Firefox you're using?

Thanks for the effort.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

gerry

Hi Walter,

I am creating a "Custom ASP.NET AJAX Client Controls" based on examples in
the Ajax Control Toolkit.

I foundthe solution : rather than returning false from the event handler , I
called event.preventDefault();
_onButtonClick : function( e ) {
alert("Click Handler.");
e.preventDefault();
}


Gerry
 
W

Walter Wang [MSFT]

Hi Gerry,

Thanks for sharing your solution here. Please feel free to let me know if
there's anything else I can help.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top