showing alert box in asp.net redirects to blank page and then back to original page
<p>I have a ASP.net page. It has 3 input boxes and a button. Clicking the button the following piece of code is executed.</p>

<pre><code> protected void buttonId_Click(object sender, EventArgs e)
    {
            // Create a request using a URL that can receive a post. 
            WebRequest request = WebRequest.Create("https://visitor2.constantcontact.com/api/signup");

            // Set the Method property of the request to POST.
            request.Method = "POST";

            // Create POST data and convert it to a byte array.
            string postData = "some secrect key";
            postData = postData + "&amp;email=" + emailadd.Text;
            postData = postData + "&amp;first_name=" +fname.Text;
            postData = postData + "&amp;last_name=" + lname.Text;
            byte[] byteArray = Encoding.UTF8.GetBytes(postData);

            // Set the ContentType property of the WebRequest.
            request.ContentType = "application/x-www-form-urlencoded";

            // Set the ContentLength property of the WebRequest.
            request.ContentLength = byteArray.Length;

            // Get the request stream.
            Stream dataStream = request.GetRequestStream();

            // Write the data to the request stream.
            dataStream.Write(byteArray, 0, byteArray.Length);

            // Close the Stream object.
            dataStream.Close();

            // Get the response.
            WebResponse response = request.GetResponse();

            // Get the stream containing content returned by the server.
            dataStream = response.GetResponseStream();

            // Open the stream using a StreamReader for easy access.
            StreamReader reader = new StreamReader(dataStream);

            // Read the content.
            string responseFromServer = reader.ReadToEnd();

            // Clean up the streams.
            reader.Close();
            dataStream.Close();
            response.Close();

            if (responseFromServer.ToLower().Contains("success"))
            {
                //signup complete
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Thanks for signing up!')", true);
            } else {
                //error occured
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Whoops! Something went wrong. Please try again.')", true);
            } 
    }
</code></pre>

<p>So the request is successfully sent and the response is received. When the following line of code runs the webpage navigates to a blank page and shows the alert.</p>

<pre><code>ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Thanks for signing up!')", true);
</code></pre>

<p>After clicking the <code>OK</code> button on the alert message it automatically navigates back to the original page.</p>

<p>How do i stop it from going to the blank page? I want the alert to show on the original page and not have to re-navigate back and forth.</p>

<p><strong>Here is my HTML</strong></p>

<pre><code>&lt;div class="footer_subscribe"&gt;
                            &lt;asp:TextBox ID="fname" runat="server" class="name" value="First Name" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'First Name';}"&gt;&lt;/asp:TextBox&gt;
                            &lt;asp:TextBox ID="lname" runat="server" class="name" value="Last Name" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Last Name';}"&gt;&lt;/asp:TextBox&gt;
                            &lt;asp:TextBox ID="emailadd" runat="server" class="name" value="Join our mailing list" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Join our mailing list';}"&gt;&lt;/asp:TextBox&gt;&lt;br&gt;

                            &lt;asp:Button ID="buttonId" OnClick="buttonId_Click" class="btn btn-info sub1" runat="server" Text="SUBSCRIBE"&gt;&lt;/asp:Button&gt;
                        &lt;/div&gt;
</code></pre>