Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Stop postback/refresh using a button...

Reply
Thread Tools

Stop postback/refresh using a button...

 
 
Matthew Wells
Guest
Posts: n/a
 
      03-01-2008
Hello.

I'm trying to use an asp - not html - button without having a postback or a
screen refresh. I've tried turning off "CausesValidation" and
"UseSubmitBehavior" and I still get a screen refresh - which makes me think
I'm doing a postback. I've also tried "return false" in both the onclick
and OnClientClick events. No Luch. Can I use the onclick or OnClientClick
(or something else) to fire a javascritpt function and then stop?

Thanks.

Matthew Wells
http://www.velocityreviews.com/forums/(E-Mail Removed)


 
Reply With Quote
 
 
 
 
Matthew Wells
Guest
Posts: n/a
 
      03-01-2008
I found the answer myself. Make sure UseSubmitBehavior" is True. Do NOT
use OnClick as that requires a server postback. Use OnClientClick and make
sure to return 'false'. It does not have to be in a response to a "confirm"
box, just "return false;". You can do anything in between that doesn't
cause a postback.


"Matthew Wells" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed). ..
> Hello.
>
> I'm trying to use an asp - not html - button without having a postback or
> a screen refresh. I've tried turning off "CausesValidation" and
> "UseSubmitBehavior" and I still get a screen refresh - which makes me
> think I'm doing a postback. I've also tried "return false" in both the
> onclick and OnClientClick events. No Luch. Can I use the onclick or
> OnClientClick (or something else) to fire a javascritpt function and then
> stop?
>
> Thanks.
>
> Matthew Wells
> (E-Mail Removed)
>



 
Reply With Quote
 
 
 
 
Paul Ireland
Guest
Posts: n/a
 
      09-16-2009
You are required to be a member to post replies. After logging in or becoming a member, you will be redirected back to this page.



Posted as a reply to:

Stop postback/refresh using a button...

Hello

I'm trying to use an asp - not html - button without having a postback or a
screen refresh. I've tried turning off "CausesValidation" and
"UseSubmitBehavior" and I still get a screen refresh - which makes me think
I'm doing a postback. I've also tried "return false" in both the onclick
and OnClientClick events. No Luch. Can I use the onclick or OnClientClick
(or something else) to fire a javascritpt function and then stop

Thanks

Matthew Well
(E-Mail Removed)

EggHeadCafe - Software Developer Portal of Choice
WCF Workflow Services Using External Data Exchange
http://www.eggheadcafe.com/tutorials...vices-usi.aspx
 
Reply With Quote
 
Ralph
Guest
Posts: n/a
 
      09-16-2009

<Paul Ireland> wrote in message
news:(E-Mail Removed)...
> You are required to be a member to post replies. After logging in or
> becoming a member, you will be redirected back to this page.
>
>
>
> Posted as a reply to:
>
> Stop postback/refresh using a button...
>
> Hello.
>
> I'm trying to use an asp - not html - button without having a postback or
> a
> screen refresh. I've tried turning off "CausesValidation" and
> "UseSubmitBehavior" and I still get a screen refresh - which makes me
> think
> I'm doing a postback. I've also tried "return false" in both the onclick
> and OnClientClick events. No Luch. Can I use the onclick or
> OnClientClick
> (or something else) to fire a javascritpt function and then stop?
>
> Thanks.
>
> Matthew Wells
> (E-Mail Removed)
>
> EggHeadCafe - Software Developer Portal of Choice
> WCF Workflow Services Using External Data Exchange
> http://www.eggheadcafe.com/tutorials...vices-usi.aspx


the following should work in the aspx to prevent postback.



<asp:Button ID="Button1" runat="server" OnClientClick="return false;"
onclick="Button1_Click" Text="Button" />




 
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
How to stop java service with command line parameter '-stop'? Will Java 1 11-02-2004 03:32 PM
f2.8 vs f3.7- Is it one stop or 2 stop difference zxcvar Digital Photography 12 05-20-2004 06:28 PM
How to stop a thread without using stop() Son KwonNam Java 11 04-09-2004 08:01 PM
Q. My browser doesn't stop, when I click on STOP. Jim Jones Computer Support 7 02-03-2004 09:47 PM
Stop Debugging doesn't stop in ASP.NET Matt Theule ASP .Net 7 07-24-2003 07:38 PM



Advertisments