Response.Redirect("~/xyz.aspx");
Server.Transfer
Response.Write("<script type="text/javaScript"> window.location.href = '~/xyz.aspx'; </script>");
string URL = Server.MapPath("~/xyz.pdf"); FileInfo fileInfo = new FileInfo(URL); if (fileInfo.Exists) { Response.Clear(); Response.AppendHeader("Content-Disposition", "attachment; filename=" + fileInfo.Name); Response.AppendHeader("Content-Length", fileInfo.Length.ToString()); Response.ContentType = "application/pdf"; Response.Flush(); Response.WriteFile(fileInfo.FullName); Response.Write("<script type="text/javaScript"> window.location.href = 'Default.aspx'; </script>"); } else { Response.Write("<script>alert('Sorry u cant download file!')</script>"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)