Open new window using Javascript or Hyperlink

G

Guest

I am trying to open a new window in two ways
1 - adding javascript to the onclick attribute of an Image button to open a
pdf document in a new window as
javascrit:window.open('MyPage.aspx',status=1,location=1,resizable=yes,scrollbars=yes)

2 - I am using a HyperLink and using the NagigateUrl property to open a pdf
in a new window with the targer set as "_Blank"

The trouble I am having is trying to keep the focus on the new window.
Sometimes it opens with the focus then almost immediately loses focus. Some
time it opens but does not have focus . It is not minimized just loses focus.
THe behavoir is inconsistent

How can i prevent this
Do i use the respone object
With Response
.ClearContent()
.ClearHeaders()
.ContentType = "application/pdf"
.Buffer = True
.WriteFile(strFileName)
.Flush()
.Close()
End With

Any ideas or suggetsions will be appreciated.
Jawahar
 
W

William F. Robertson, Jr.

window.open returns a reference to the new window. Could you focus it that
way?

javascript: newWindow = window.open( '...' ); newWindow.focus();

bill
 
J

James Doughty

Do you have smart navigation turned on? This caused me problems and I
have to rewrite a pieve of the smartnav script.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top