Response.Write from within a class module
Posted on 2008-10-23
I've build an VB class module that gathers data for a report, creates a PDF image of the finished report, and then attempts to issue a Response.Write statement to open the PDF report as follows:
Response.Write("<script>window.open('" & HttpPath & "',target='_blank');</script>")
This causes 'Name Reponse is not Declared' to display and the project will not compile.
Looking at article I found here on Expert Exchange, I attempted the following code:
Dim app As HttpApplication
app.Context.Response.Write("<script>window.open('" & HttpPath & "',target='_blank');</script>")
This statement fails saying that app is a null reference.
I just can't seem to win here!
Can someone please tell me how to accomplish, what seems like should be, this simple task.
Thank you, Herb