title: Implementing a download with SaveAs dialog box in ASP.Net
body: <p>I am trying to show a PopUp to Save a file and the user has to choose the destination and change file type if he actually needs. I read many articles still not getting clear idea of what to do since I am new to .Net.
     This is the code.When I run the code and click link buttons in grid view the file will be downloaded without popup and without even asking User's permission where the downloaded files must be saved</p>
  
  <pre><code>    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
      {
          if(e.CommandName == "Download")
          {
              Response.Clear();
              Response.ContentType = "application/octet-stream";
              Response.AppendHeader("content-disposition","attachment; filename=" + e.CommandArgument);
              Response.TransmitFile(Server.MapPath("~/UploadedFiles/") + e.CommandArgument);
              Response.End();
  
          }
  
      }
  </code></pre>
  
  <p>I need the following to be achieved.</p>
  
  <ul>
  <li><p>Display a SaveAs File dialog Box</p></li>
  <li><p>The type of file should automatically be displayed in SaveAs dialog box.Eg if the type of file is image then in SaveAs dialog box .jpg should be automatically displayed. 
  I have attached image of my output here
  <img src="https://i.stack.imgur.com/0MbFe.png" alt="enter image description here">
  I am not really clear with this concept.Please help Thanks in advance </p></li>
  </ul>