Para poder abrir un documento en aspx en una nueva ventana del lado de back end se debe poder este codigo, en la pagina en la que se envia el llamdo esto para invocar a window.open del lado de javascript
Dim url As String = "MuestraDocumento.aspx?Documento=thinkpython.pdf"
Dim target As String = "'_blank'"
Dim script As String = "window.open('" & url & "'," & target & "," & "'status=no, menubar=no, toolbar=no,location=no');"
Page.ClientScript.RegisterStartupScript(Me.GetType, "someUniqueId", script, True)
y en la pagina que recibe la informacion
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
Response.ContentType = "application/pdf"
Response.Clear()
Response.TransmitFile("C:\Carlos\Libros\" + Request.QueryString("Documento"))
Response.End()
End Sub
Felices lineas
Dim url As String = "MuestraDocumento.aspx?Documento=thinkpython.pdf"
Dim target As String = "'_blank'"
Dim script As String = "window.open('" & url & "'," & target & "," & "'status=no, menubar=no, toolbar=no,location=no');"
Page.ClientScript.RegisterStartupScript(Me.GetType, "someUniqueId", script, True)
y en la pagina que recibe la informacion
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
Response.ContentType = "application/pdf"
Response.Clear()
Response.TransmitFile("C:\Carlos\Libros\" + Request.QueryString("Documento"))
Response.End()
End Sub
Felices lineas
No hay comentarios.:
Publicar un comentario