title: Download feature not working within update panel in asp.net
body: <p>I have a Web User Control containing a <code>FormView</code>. The formview shows details of job seeker. I have provided a button for "Download Resume" link, so that admin/HR can download the resume. I have placed this control in an aspx page that contains the UpdatePanel. Everything works fine except Download Link. </p>
  
  <p>I have given a Command on donwload link button and a function is associated with the command to start download. </p>
  
  <p>Below is the code i have implemented -</p>
  
  <pre><code>//Command on 'Download' link button within FormView
  protected void lnkDownload_Command(object sender, CommandEventArgs e)
  {
      if (e.CommandName.Equals("Download"))
      {
          StartDownload(e.CommandArgument.ToString());
      }
  }
  
  //My routine to download document
  //sFileInfo contains filepath$==$mimetype
  protected void StartDownload(string sFileInfo)
  {
      string[] d = sFileInfo.ToString().Split((new string[] { "$==$" }), StringSplitOptions.None);
      string filename = d[0];
      string docType = d[1];
  
      System.IO.FileInfo file = new System.IO.FileInfo(d[0]);
  
      if (file.Exists)
      {
          Response.Clear();
          Response.AddHeader("Content-Disposition", "attachment; filename=" + d[0]);
          Response.AddHeader("Content-Length", file.Length.ToString());
          Response.ContentType = d[1];
          Response.WriteFile(file.FullName);
          Response.End();
      }
      else
      {
          Server.Transfer("~/Mesgbox.aspx?cat=2");
      }
  }
  </code></pre>
  
  <p>The code works perfectly if update panel is removed but generates script errors if update panel is used. </p>
  
  <p>Any suggestions....?</p>
  
  <p>Thanks for sharing your time.</p>