stop refreshing page on button click

Total Post:183

Points:1285

 1505  View(s)
Ratings:
Rate this:
Hi Mindstickians!

I need to make the asp button to not refresh the whole page when I click it.

my code is just to make a picture change to another picture but the index of the picture is set in the page load method. And every time you click the button 

to go to the next picture index, the whole page refreshes and calls the page load method. That then sets the index back to 0.

how can I make the page stop calling the page load method when I click a button

Thanks in advance!
  1. Re: stop refreshing page on button click

    Hi Ankita!

    set button event property as below

    OnClientClick="return false;"
    and that will stop it from posting back the page. This will allow you to do whatever it is you need to do. Now, if you're already running JavaScript in that 

    click, which it appears you might be, just return false; from that method.

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.