| 在代码隐藏页的 Page_Load 事件中,加入以下代码: private void Page_Load(object sender, System.EventArgs e) { //Set the appropriate ContentType. Response.ContentType = "Application/pdf"; //Get the physical path to the file. string FilePath = MapPath("acrobat.pdf"); //Write the file directly to the HTTP content output stream. Response.WriteFile(FilePath); Response.End(); } |