onRowCommand gets fired again on refreshing the page
<p>In my web page i have a gridview which contains link to download file and link to open another web site in separate page.When i click on link gridview onRowCommand gets executed and website opens in separate window.After this when i refresh the web page, gridview onRowCommand get executed again and opens web site in separate window again which i dont want.I want that when i click on link to navigate to another web site then only it should go.I mean on page refresh, gridview onRowCommand should not get executed.  </p>

<p>I am using Page.RegisterStartupScript to open another web site in separate window.</p>

<p>ASP.net 2.0</p>

<p>thanks</p>

<p>-------------------------------------------code----------------</p>

<p>protected void grdDisplayView_onRowCommand(object sender, GridViewCommandEventArgs e)
    {
         string path = e.CommandArgument.ToString();</p>

<pre><code>        if (path.Contains("http"))
        {
            StringBuilder sbString = new StringBuilder("&lt;script language='javascript'&gt;");
            sbString.Append("window.open('");
            sbString.Append("http://www.yahoo.com','', 'status=no,width=600,height=500,toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes,titlebar=yes,top=198,left=305');");
            sbString.Append("&lt;/script&gt;");

            if ((!Page.ClientScript.IsStartupScriptRegistered("clientScriptExportView")))
            {
                Page.RegisterStartupScript("clientScriptExportView",sbString.ToString());
            }

        }
        else
        {
   //download file which is locally
            path = Server.MapPath(path);
            System.IO.FileInfo file = new System.IO.FileInfo(path);

                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
                HttpContext.Current.Response.AddHeader("Content-Length", file.Length.ToString());
                HttpContext.Current.Response.ContentType = "Application/octet-stream";
                HttpContext.Current.Response.WriteFile(file.FullName);
                HttpContext.Current.Response.End();


        }

    }
</code></pre>
