Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > stop button postback ajax in non-ie

Reply
Thread Tools

stop button postback ajax in non-ie

 
 
gerry
Guest
Posts: n/a
 
      11-21-2007
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


 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      11-22-2007
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 ((E-Mail Removed), 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.

 
Reply With Quote
 
 
 
 
gerry
Guest
Posts: n/a
 
      11-22-2007
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



""Walter Wang [MSFT]"" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 ((E-Mail Removed), 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.
>



 
Reply With Quote
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      11-23-2007
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 ((E-Mail Removed), 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop postback/refresh using a button... Matthew Wells ASP .Net 3 09-16-2009 01:14 PM
AJAX Treeview How to keep expanded nodes expanded during AJAX postback ton ASP .Net 2 12-10-2008 04:11 PM
AJAX IDE and AJAX TOOL--The Release of JoyiStar AJAX WebShop 3 Beta minnie Java 1 12-13-2006 06:29 AM
Stop Postback in image button nachoenjuto@gmail.com ASP .Net Web Controls 1 07-26-2006 04:09 PM
stop postback in postback events for server controls ?? Wael_Bakr ASP .Net Web Controls 0 11-30-2005 08:06 AM



Advertisments