ASP.NET Why is this shortening url code redirecting to page
<p>Hey I have the following method</p>

<pre><code>public static string GetShortenedURL(String inURL)
{
    String shortURL = "";
    String queryURL = "http://api.bit.ly/shorten?version=2.0.1&amp;longUrl=" + inURL + "&amp;login=&amp;apiKey=";

    HttpWebRequest request = WebRequest.Create(queryURL) as HttpWebRequest;

    using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
    {
        StreamReader reader = new StreamReader(response.GetResponseStream());
        string jsonResults = reader.ReadToEnd();
        int indexOfBefore = jsonResults.IndexOf("shortUrl\": \"") + 12;
        int indexOfAfter = jsonResults.IndexOf("\"", indexOfBefore);
        shortURL = jsonResults.Substring(indexOfBefore, indexOfAfter - indexOfBefore);

    }

    return shortURL;
}
</code></pre>

<p>Which worked fine on my development machine, but on live server for some reason whenever I call this method I actually seems to visit the URL aswell. The reason why this is a problem is because that URL updates a status of a record. But I only want to do this when the user clicks on the link in the mail but for some very weird reason when Im creating the email on my confirmation page of registration and call this shortened URL method so I can add the short URL in my mail to send out,
it seems to visit it by itself. Hence updating my status when it shouldnt yet.</p>

<p>Any Ideas ?</p>

<p>EDIT : This is how i call it</p>

<p>emailBody.Append(M1Utils.GetShortenedURL(ConfigurationSettings.AppSettings["strSite_FEURL"].ToString() + "login/verify.aspx?" + strEncrypted)).Append("\r\n\r\n");</p>
