Redirection d'une page d'un fichier PDF à télécharger

J'ai un aspx (disons 1.aspx) de la page à partir de laquelle d'abord, je suis le téléchargement d'un fichier pdf et ensuite, je veux rediriger vers des Remerciements.page aspx. Le code est: est-ce

protected void btnSubmit_Click(object sender, EventArgs e)
{
    string pathId = string.Empty;
    if (Page.IsValid)
    {
        try
        {    
            pathId = hidId.Value;
            DownloadPDF(pathId);                        

            Response.Redirect("Thanks.aspx");
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
}



protected void DownloadPDF(string pathId)
{
    if (!(string.IsNullOrEmpty(pathId)))
    {
         try
        {
            Response.ContentType = "application/pdf";
            Response.AppendHeader("Content-Disposition", "attachment; filename=" + pathId + ".pdf");
            string path = ConfigurationManager.AppSettings["Pdf_Path"].ToString() + "\\" + pathId.Trim() + ".pdf";
            Response.TransmitFile(path);                   
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            HttpContext.Current.ApplicationInstance.CompleteRequest();
        }
    }
}

Le problème est que, dans la boîte de dialogue d'enregistrement de fichier est venue correctement et je suis en mesure de télécharger le fichier aussi, mais il n'est pas redirigé vers la Grâce.page aspx.

Comment résoudre ce problème?

OriginalL'auteur priyanka.bangalore | 2010-02-18