Как открыть файл. pdf в новом окне?
I have the following code string path = Server.MapPath("\\Reports\\" + DDEP.SelectedValue + ".pdf"); ClientScript.RegisterStartupScript(this.GetType(), "open", "window.open('"+path+"','_blank' );", true); I am trying to open the .pdf in a new window but its opening a blank window. thanks for the help
Что я уже пробовал:
string path = Server.MapPath("\\Reports\\" + DDEP.SelectedValue + ".pdf"); ClientScript.RegisterStartupScript(this.GetType(), "open", "window.open('"+path+"','_blank' );", true);
/* StringBuilder sb = new StringBuilder(); sb.Append("<script type = 'text/javascript'>"); sb.Append("window.open('"); sb.Append(Server.MapPath("\\Reports\\" + DDEP.SelectedValue + ".pdf")); sb.Append("');"); sb.Append("</script>"); ClientScript.RegisterStartupScript(this.GetType(), "script", sb.ToString()); */