473,226 Members | 1,655 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,226 software developers and data experts.

How do I open a new browser window programmatically?

How do I open and change properties of (such as size, position, scroll
position, visibility of toolbars, etc.) a browser window? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Nov 19 '05 #1
5 7789
Roy
Use javascript.

<SCRIPT LANGUAGE="javascript">window.open('somepage.html') </SCRIPT>

is the basic syntax.
Nathan Sokalski wrote:
How do I open and change properties of (such as size, position, scroll
position, visibility of toolbars, etc.) a browser window? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/


Nov 19 '05 #2
I know how to open a new window using Javascript, and id I have to manually
write the Javascript that's OK, but how do I call the Javascript from a
method in ASP.NET code? For example, I want the new window to open when a
specific event occurs on my page. (I use VB.NET as my language when making
my ASP.NET pages) How do I do this? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Roy" <ro**********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Use javascript.

<SCRIPT LANGUAGE="javascript">window.open('somepage.html') </SCRIPT>

is the basic syntax.
Nathan Sokalski wrote:
How do I open and change properties of (such as size, position, scroll
position, visibility of toolbars, etc.) a browser window? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Nov 19 '05 #3
You can open windows with the javascript window.open method.
Here's more info:
http://SteveOrr.net/articles/ClientSideSuite.aspx
http://msdn.microsoft.com/workshop/a...ods/open_0.asp

Some popup blockers may foil your plans however, so consider alternate
designs.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:uP**************@TK2MSFTNGP12.phx.gbl...
How do I open and change properties of (such as size, position, scroll
position, visibility of toolbars, etc.) a browser window? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Nov 19 '05 #4
I understand everything about the Javascript window.open method and how
popup blockers may cause problems when using it. This is why I have been
looking for a way to open a new browser window using ASP.NET without
manually writing the Javascript. But if I do use Javascript, how do I tell
ASP.NET code written in VB.NET to call it? The specific purpose I plan to
use this for is when to open a printable version of a page when the user
clicks a button. I would rather use an ImageButton control than nest and
Image control inside of a HyperLink control with a Target property of
_blank. This way I can use less controls and I would also like to use the
CommandArgument property of the ImageButton control. Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:OP****************@TK2MSFTNGP14.phx.gbl...
You can open windows with the javascript window.open method.
Here's more info:
http://SteveOrr.net/articles/ClientSideSuite.aspx
http://msdn.microsoft.com/workshop/a...ods/open_0.asp

Some popup blockers may foil your plans however, so consider alternate
designs.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:uP**************@TK2MSFTNGP12.phx.gbl...
How do I open and change properties of (such as size, position, scroll
position, visibility of toolbars, etc.) a browser window? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/


Nov 19 '05 #5
Roy
I noticed from your other message that you're trying to use ASP.NET to
open a new window. Long story short: you can't (or at least not in any
comparably simple way that javascript allows for). Ya gotta use
javascript.

I did a job similar to what you're describing not too long ago. I
placed the javascript syntax within a global VB variable in the
page_load area. You may already know that VB.NET = server-side and
javascript = client-side. By placing the javascript within a VB
variable you get around this and sorta merge the two, but I digress...
In the button click event (I was using a <asp:buttton> in my job) I did
a response.write() *using that variable* and thusly passed back the
javascript back to the client for processing.

Nathan Sokalski wrote:
I know how to open a new window using Javascript, and id I have to manually
write the Javascript that's OK, but how do I call the Javascript from a
method in ASP.NET code? For example, I want the new window to open when a
specific event occurs on my page. (I use VB.NET as my language when making
my ASP.NET pages) How do I do this? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/


Nov 19 '05 #6

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...
6
by: lukeo | last post by:
I'm shelling out to an .asp (or htm) page from an application. I want to show this in a window without the address bar, etc... Is there a way I can redirect this page using javascript to a page...
2
by: venkatesh | last post by:
Hi Members, I have used the below mentioned code to open a html page in a new browser. The window size is 200 x 300. In that browser, I've given code to open another browser of the same size....
10
by: Marshall Dudley | last post by:
When I do the following line in Netscape, the popup loads as it should, but the parent window usually, but not always, reloads as well. <a href="#"...
4
by: google | last post by:
Hi there, I've searched high and low for this, but it seems most people are looking to establish (and control) the relationship between a parent browser window and it's associated child window...
3
by: Bob | last post by:
I am trying to create a popup page (to act as a menu) from a parent page. When the parent page (index.jsp) calls my popup function (see below) it will properly open the correct size browser window...
4
by: cgia | last post by:
I would like to return error message in a pop up window. Window.open would be great, but it can only be associated to the onclick event of the button: button.Attributes.Add("onclick",... Any...
7
by: Toccoa | last post by:
After considerable googling - I mean searching with Google(r) - I could not find javascript on a button or <a href=... to close a window in the latest versions of IE and FireFox. There seemed...
1
by: kia | last post by:
Is there any way with JavaScript(I mean programmatically) that we can open the window as a new foreground tab, every time a new tabbed window is opened? For example, like IE7, when user clicks a...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.