Link to home
Create AccountLog in
Avatar of Joachim Carrein
Joachim CarreinFlag for Belgium

asked on

Popup window instantly closes

hi,

i used a script registred at runtime to open a popup window to open a word document that is created at runtime.

i register this script:

<script language=javascript>
window.open('export/marika/ShipList.doc','newpage_docs','');
</script>

i have to make it open in a new page, because otherwise it opens within a frame, and internet explorer can apparently not print it then...

So now my problem:
i see the new page open, but it instantly closes...
i know for sure that the word document exists. have i forgotten something?

here is my asp.net code to create the script:
Dim sScript As String
sScript = "<script language=javascript>" & vbCrLf & _
               "window.open('" & Session("labelsdoc") & "','newpage_docs',''); " & vbCrLf & _
               "</script>"
If Session("labelsdoc") <> "" Then Page.RegisterClientScriptBlock("clientscript", sScript)

i have no anti popup software installed, all i had to do the first time was say to IE7 that this site is allowed for popups
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

1) What authentication mode are you using with the web site?  Are you allowing anonymous access?

2) If you allow anonymous, then does ASPNET user have access to that file?

Bob
Avatar of Joachim Carrein

ASKER

when i just let the file open without the popup, it opens without problems, there is anonymous access in a sort of way.

users have to log in, but that login is only tested on my pages, not on every single document.
What is the complete URL for the Word document?

Bob
Did you try with the complete URL?

Bob
just tried it, and it does the same
i just tried something, that is some sort of workaround, but i don't know if it is a good way to go...
<script language=javascript>
window.open('load.aspx?link=export/marika/ShipList.doc','newpage_docs');
</script>

and on the load.aspx page:
<meta http-equiv="refresh" content="0;URL=<%=request("link")%>" />
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer