473,385 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Open new window using Javascript or Hyperlink

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
2 7318
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Paul | last post by:
I link to a web site from an Excel spreadsheet. The page i link to is getCookie.asp which sets a cookie then returns back some html which opens a new window, to the same site but a different page...
40
by: Brian Jorgenson | last post by:
On my web page, I have a few hyperlinks with target frame of _blank. The hyperlink brings up a second window, but everytime I click on thie hperlink, it keeps bringing up a new window and not...
4
by: Olav Tollefsen | last post by:
I have an <asp:Hyperlink> in my .aspx file. How can I configure it to open the URL (NavigateURL) in a popup window instead of a new normal browser window. I use Target="_blank", but didn't find...
4
by: KenG | last post by:
Hi: I have a datagrid that builds a hyperling which uses javascript to open a new window. The new window opens and displays fine, however, the original window that has the grid, is now blank...
8
by: Dan | last post by:
hello all, is there a way to open a new window without javascript and a href=_blank? i need to connect a button click with some lines of code and then, a new window shall get opened. but i didn't...
5
by: Chris | last post by:
Hello, I have a link on an aspx page. The URL is set in the Page Load event: lnkEventHistory.NavigateUrl = "javascript:window.open('EventHistory.aspx?TeenID=" & _ Request.Item("SubjectID") &...
9
by: loga123 | last post by:
I am using asp .net 2.0. I have a hyperlink asp control on my web page page1.aspx. On clicking this hyper;link, I would like to open page2.aspx (which is in the same web application) in a new IE...
9
by: smokeyd | last post by:
hi, can anyone tell me how to open a link in a new browser window in vbscript.net. i am looking to be able to set the properties such as size, menu bar, scroll bar etc. or alternativelly is...
6
by: bushi | last post by:
hi everyone! i have diplayed my hyperlinks in a iframe.when i redirect to next page.the next page also open in the same frame,but i want to open a new browser window,when i click on the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.