How not to refresh a page from JavaScript?
<p>I am working on a website using <code>asp.Net</code>, and it includes a page called from an <code>iframe</code>.
This page named Districting, has a javascript code in the aspx page.
I created a function, that is executed when "Done" button is clicked. This function tests if the conditions that the user made are true.
If yes, another page is loaded, if no, an alert appears, and nothing happens.
But actually, something is happening: the page is refreshing which is not what I want.
This is the button:</p>

<pre><code>&lt;button id="Button1" onclick="testing()"&gt;Done&lt;/button&gt;
</code></pre>

<p>This is the function testing:</p>

<pre><code>function testing() {
    if (conditions are true)
        //Go to another page
    else{
        alert("Wrong decision");
        //Stay in the current page without refreshing it
    }
 }
</code></pre>

<p>So all I need is to prevent the page from refreshing when clicking on "Done" button.</p>

<p>Thanks in advance:)</p>
