By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,300 Members | 1,795 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,300 IT Pros & Developers. It's quick & easy.

Open new window using Javascript or Hyperlink

P: n/a
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,locat ion=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
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


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

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

bill

"Jawahar" <Ja*****@discussions.microsoft.com> wrote in message
news:72**********************************@microsof t.com...
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,locat ion=1,resizable=yes,scroll
bars=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

Nov 19 '05 #2

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

"=?Utf-8?B?SmF3YWhhcg==?=" <Ja*****@discussions.microsoft.com> wrote in
news:72**********************************@microsof t.com:
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,locat ion=1,resizable=yes,s
crollbars=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


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.