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

How do I spawn a new IE window with no toolbar?

On some websites I've seen by clicking on a button or hlink a new IE browser
window is spawned that does NOT have any toolbar (ie No back button, etc...)

How can I do this on my ASPX page?

Thanks.
Nov 17 '05 #1
8 1896
JavaScript. Find a site that has that functionality you like and view the
source of the page. Copy and paste into your code. Since it is JavaScript
it will be viewable in the source unlike VB.NET or C# code that would
otherwise be compiled into IL.

Good luck.

Mark
"VB Programmer" <gr*********@go-intech.com> wrote in message
news:e7**************@TK2MSFTNGP09.phx.gbl...
On some websites I've seen by clicking on a button or hlink a new IE browser window is spawned that does NOT have any toolbar (ie No back button, etc...)
How can I do this on my ASPX page?

Thanks.

Nov 17 '05 #2
Below is an example that will get you started ... it spawns the new window,
but includes a toolbar.

//JavaScript that opens a hyperlink in a new browser window.
StringBuilder sb = new StringBuilder();
sb.Append("<script language=\"javascript\">" + Environment.NewLine);
sb.Append("<!--"+ Environment.NewLine);
sb.Append("function popup(mylink, windowname)"+ Environment.NewLine);
sb.Append("{"+ Environment.NewLine);
sb.Append("if (! window.focus)return true;"+ Environment.NewLine);
sb.Append("var href;"+ Environment.NewLine);
sb.Append("if (typeof(mylink) == 'string')"+ Environment.NewLine);
sb.Append("href=mylink;"+ Environment.NewLine);
sb.Append("else"+ Environment.NewLine);
sb.Append("href=mylink.href;"+ Environment.NewLine);
sb.Append("window.open(href,
windowname,'width=700,height=400,scrollbars=yes,st atus=yes,menubar=yes,locat
ion=yes,toolbar=yes');"+ Environment.NewLine);
sb.Append("return false;"+ Environment.NewLine);
sb.Append("}"+ Environment.NewLine);
sb.Append("//-->"+ Environment.NewLine);
sb.Append("</script>"+ Environment.NewLine);
LiteralControl lc = new LiteralControl(sb.ToString());
this.Controls.Add(lc);

hth, mark
www.dovetaildatabases.com

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:e7**************@TK2MSFTNGP09.phx.gbl...
On some websites I've seen by clicking on a button or hlink a new IE browser window is spawned that does NOT have any toolbar (ie No back button, etc...)
How can I do this on my ASPX page?

Thanks.

Nov 17 '05 #3
window.open () function accepts a toolbar and menubar parameter you can set
these to no

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"VB Programmer" <gr*********@go-intech.com> wrote in message
news:e7**************@TK2MSFTNGP09.phx.gbl...
On some websites I've seen by clicking on a button or hlink a new IE browser window is spawned that does NOT have any toolbar (ie No back button, etc...)
How can I do this on my ASPX page?

Thanks.

Nov 17 '05 #4
VBProgrammer,

If you want, I created a Javascript component that has a few commonly used
javascripts in it that makes it easy to attach them to a page and then any
object on the page. A popup window with options for exactly what parts to
display is one of the functions. I provide it for free and the entire
project is downloadable from my web site, www.aboutfortunate.com. Just
click the code library link and then click the "Javascript" button in the
menu on the left.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"VB Programmer" <gr*********@go-intech.com> wrote in message
news:e7**************@TK2MSFTNGP09.phx.gbl...
On some websites I've seen by clicking on a button or hlink a new IE browser window is spawned that does NOT have any toolbar (ie No back button, etc...)
How can I do this on my ASPX page?

Thanks.

Nov 17 '05 #5
No offence, but how about something a little more elegant, readable, and a
bit faster, and doesnt require the use ot a Literal

Add the following to your Page_Load (you can even make the the string a
static readonly field on your page class)

string popupScript =
@"<script language=""javascript"">
<!--
function popup(mylink, windowname) {
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href,
windowname,'width=700,height=400,scrollbars=yes,st atus=yes,menubar=yes,locat
ion=yes,toolbar=yes');
return false;
}
//-->
</script>";
RegisterClientScriptBlock("popup" , s);
Or place the script in a separate file (ie popup.js) and add the following
to the top of your page:

<script language="javascript" src="popup.js" >

HTH
Brian W
"Mark" <fi**************@umn.edu> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Below is an example that will get you started ... it spawns the new window, but includes a toolbar.

//JavaScript that opens a hyperlink in a new browser window.
StringBuilder sb = new StringBuilder();
sb.Append("<script language=\"javascript\">" + Environment.NewLine);
sb.Append("<!--"+ Environment.NewLine);
sb.Append("function popup(mylink, windowname)"+ Environment.NewLine);
sb.Append("{"+ Environment.NewLine);
sb.Append("if (! window.focus)return true;"+ Environment.NewLine);
sb.Append("var href;"+ Environment.NewLine);
sb.Append("if (typeof(mylink) == 'string')"+ Environment.NewLine);
sb.Append("href=mylink;"+ Environment.NewLine);
sb.Append("else"+ Environment.NewLine);
sb.Append("href=mylink.href;"+ Environment.NewLine);
sb.Append("window.open(href,
windowname,'width=700,height=400,scrollbars=yes,st atus=yes,menubar=yes,locat ion=yes,toolbar=yes');"+ Environment.NewLine);
sb.Append("return false;"+ Environment.NewLine);
sb.Append("}"+ Environment.NewLine);
sb.Append("//-->"+ Environment.NewLine);
sb.Append("</script>"+ Environment.NewLine);
LiteralControl lc = new LiteralControl(sb.ToString());
this.Controls.Add(lc);

hth, mark
www.dovetaildatabases.com

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:e7**************@TK2MSFTNGP09.phx.gbl...
On some websites I've seen by clicking on a button or hlink a new IE

browser
window is spawned that does NOT have any toolbar (ie No back button,

etc...)

How can I do this on my ASPX page?

Thanks.


Nov 17 '05 #6
I'd agree that in most cases that would be faster and more elegant. The
code I copied from was in the
protected override void CreateChildControls()

event of a custom control. In custom controls, you can't paste in raw
script like you can in a .aspx or user control.

Mark
"Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
No offence, but how about something a little more elegant, readable, and a
bit faster, and doesnt require the use ot a Literal

Add the following to your Page_Load (you can even make the the string a
static readonly field on your page class)

string popupScript =
@"<script language=""javascript"">
<!--
function popup(mylink, windowname) {
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href,
windowname,'width=700,height=400,scrollbars=yes,st atus=yes,menubar=yes,locat ion=yes,toolbar=yes');
return false;
}
//-->
</script>";
RegisterClientScriptBlock("popup" , s);
Or place the script in a separate file (ie popup.js) and add the following
to the top of your page:

<script language="javascript" src="popup.js" >

HTH
Brian W
"Mark" <fi**************@umn.edu> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Below is an example that will get you started ... it spawns the new

window,
but includes a toolbar.

//JavaScript that opens a hyperlink in a new browser window.
StringBuilder sb = new StringBuilder();
sb.Append("<script language=\"javascript\">" + Environment.NewLine);
sb.Append("<!--"+ Environment.NewLine);
sb.Append("function popup(mylink, windowname)"+ Environment.NewLine);
sb.Append("{"+ Environment.NewLine);
sb.Append("if (! window.focus)return true;"+ Environment.NewLine);
sb.Append("var href;"+ Environment.NewLine);
sb.Append("if (typeof(mylink) == 'string')"+ Environment.NewLine);
sb.Append("href=mylink;"+ Environment.NewLine);
sb.Append("else"+ Environment.NewLine);
sb.Append("href=mylink.href;"+ Environment.NewLine);
sb.Append("window.open(href,

windowname,'width=700,height=400,scrollbars=yes,st atus=yes,menubar=yes,locat
ion=yes,toolbar=yes');"+ Environment.NewLine);
sb.Append("return false;"+ Environment.NewLine);
sb.Append("}"+ Environment.NewLine);
sb.Append("//-->"+ Environment.NewLine);
sb.Append("</script>"+ Environment.NewLine);
LiteralControl lc = new LiteralControl(sb.ToString());
this.Controls.Add(lc);

hth, mark
www.dovetaildatabases.com

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:e7**************@TK2MSFTNGP09.phx.gbl...
On some websites I've seen by clicking on a button or hlink a new IE

browser
window is spawned that does NOT have any toolbar (ie No back button,

etc...)

How can I do this on my ASPX page?

Thanks.



Nov 17 '05 #7
>
event of a custom control. In custom controls, you can't paste in raw
script like you can in a .aspx or user control.

Sure you can. That is what Page.RegisterClientScriptBlock() is for.

Brian W
Mark
"Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
No offence, but how about something a little more elegant, readable, and a
bit faster, and doesnt require the use ot a Literal

Add the following to your Page_Load (you can even make the the string a
static readonly field on your page class)

string popupScript =
@"<script language=""javascript"">
<!--
function popup(mylink, windowname) {
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href,

windowname,'width=700,height=400,scrollbars=yes,st atus=yes,menubar=yes,locat
ion=yes,toolbar=yes');
return false;
}
//-->
</script>";
RegisterClientScriptBlock("popup" , s);
Or place the script in a separate file (ie popup.js) and add the following to the top of your page:

<script language="javascript" src="popup.js" >

HTH
Brian W
"Mark" <fi**************@umn.edu> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Below is an example that will get you started ... it spawns the new

window,
but includes a toolbar.

//JavaScript that opens a hyperlink in a new browser window.
StringBuilder sb = new StringBuilder();
sb.Append("<script language=\"javascript\">" + Environment.NewLine);
sb.Append("<!--"+ Environment.NewLine);
sb.Append("function popup(mylink, windowname)"+ Environment.NewLine);
sb.Append("{"+ Environment.NewLine);
sb.Append("if (! window.focus)return true;"+ Environment.NewLine);
sb.Append("var href;"+ Environment.NewLine);
sb.Append("if (typeof(mylink) == 'string')"+ Environment.NewLine);
sb.Append("href=mylink;"+ Environment.NewLine);
sb.Append("else"+ Environment.NewLine);
sb.Append("href=mylink.href;"+ Environment.NewLine);
sb.Append("window.open(href,

windowname,'width=700,height=400,scrollbars=yes,st atus=yes,menubar=yes,locat
ion=yes,toolbar=yes');"+ Environment.NewLine);
sb.Append("return false;"+ Environment.NewLine);
sb.Append("}"+ Environment.NewLine);
sb.Append("//-->"+ Environment.NewLine);
sb.Append("</script>"+ Environment.NewLine);
LiteralControl lc = new LiteralControl(sb.ToString());
this.Controls.Add(lc);

hth, mark
www.dovetaildatabases.com

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:e7**************@TK2MSFTNGP09.phx.gbl...
> On some websites I've seen by clicking on a button or hlink a new IE
browser
> window is spawned that does NOT have any toolbar (ie No back button,
etc...)
>
> How can I do this on my ASPX page?
>
> Thanks.
>
>



Nov 17 '05 #8
Thanks EVERYONE for their insight and help!!! This newsgroup is awesome.

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:e7**************@TK2MSFTNGP09.phx.gbl...
On some websites I've seen by clicking on a button or hlink a new IE browser window is spawned that does NOT have any toolbar (ie No back button, etc...)
How can I do this on my ASPX page?

Thanks.

Nov 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Scott | last post by:
I'm new to ASP, but I've been programming in VB for several years, and I'm having a few issues with this ASP enhancement I'm working on. I've found ASP to be a lot different than what I'm use to...
3
by: Chris | last post by:
Hi I have designed my website to fit my standard windows. I use a javascript scroller that nescitates the removal of the browser scroll bars. However if a user has an extra toolbar open in...
2
by: Richard Gutery | last post by:
G'day. Trying to open a new window in an ASP script. Here is the code snippet I am trying to use: private sub OpenWin() window.open...
2
by: tmb | last post by:
- Want to open a 2nd browser window when someone clinks a link with the link content inside it. - Want to control window size - Want all tool bars so only blue bar at top shows - Can I put my...
4
by: darius | last post by:
Hello, I seem to be having trouble with a rather simple problem. I am opening a new window with the window.open command, and even though I set scrollbar=yes, I can't seem to get the window to...
7
by: Merlin | last post by:
Hi there, I have a problem with opening new windows with JS. If the webpage did not complete loading due to any reason a click on a link which is supposed to open a small new other window loads...
3
by: Kamyk | last post by:
Hello all! I would like to open a new window with a picture after clicking on a shrinked picture which is located on the main page. I want this new window to be exactly sized as original...
11
by: Dave | last post by:
For some reason, the below lines only work on select machines. All machines are running IE6. IE SP's and OS's vary. When it doesn't work, default.aspx (the page that this code is in) opens and...
1
by: Socrates | last post by:
Hi - Have tried for half and hour to get this script to work: I am trying to close the parent window while opening a centred new child window I would be grateful if someone could correct 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$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.