473,326 Members | 2,012 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,326 software developers and data experts.

New Browser Window

HI,
This is realy a stupid problem but I cannot find a solution, please help.
I have a asp.net page that displays after a user has logged on to the
system. On this page is a couple of options and depending which option, a
different asp page opens when a BUTTON IS CLICKED. I would like to know how
to progrm the button so that a new browser window opens and not close the
previous one. In the old HTML it was easy, I just used _blank and there you
go. I am using VB on my asp page.

Thanks
Elmo
Nov 19 '05 #1
4 1243
Hi Elmo,

welcome to ASPNET newsgroup.
As for the question you mentioned, is the button on your ASP.NET page a
normal html button element or an ASP.NET Button Server Control. For open
a new browser window, generally we can use the jscript function
window.open( ) to open a new page and this is often used for a html button
or link's click event. For example:

<input type="button" value="open new window"
onclick="window.open('http://www.asp.net')" />

#be care that such opened window maybe blocked by some popup blockers such
as the one in WIN XP SP2.

If the button is a asp.net button Server control, since the button's click
event is a serverside event, we may need to dynamically inject clientside
jscript code in the Button_click server side event. and the
Page.RegisterStartupScript function may help on this. For example:

private void btnServerOpen_Click(object sender, System.EventArgs e)
{
Page.RegisterStartupScript("open_new","<script
language='jscript'>window.open('http://www.asp.net');</script>");
}

If there're anything unclear or other questions, please feel free to post
here. Hope helps.

Thanks,'

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| NNTP-Posting-Date: Tue, 19 Jul 2005 01:35:44 -0500
| X-Trace-PostClient-IP: 196.14.185.74
| From: "elmo" <el**@delphisure.com>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: New Browser Window
| Date: Tue, 19 Jul 2005 08:45:04 +0200
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <Zv********************@is.co.za>
| Lines: 13
| NNTP-Posting-Host: 168.209.98.66
| X-Trace:
sv3-3XskQuB8LEaudaMmnUW8XNsNSISEZI5E6AVLBF0WukGUEC1Lnz Mm5PlFXRb9EmlBl/bw0WTG
aTpIG+Q!vzNSHT94y+lhwkOFSnHXe0fnecTssGPbEqp6a1FNlT W2WdnROiZqDxiScjxfiyrrutM=
| X-Complaints-To: ab***@is.co.za
| X-DMCA-Complaints-To: ab***@is.co.za
| X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
| X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
complaint properly
| X-Postfilter: 1.3.32
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornad o.fastwebnet.it!tiscali!ne
wsfeed1.ip.tiscali.net!news.maxwell.syr.edu!newsco n02.news.prodigy.com!newsc
on06.news.prodigy.com!prodigy.net!border1.nntp.dca .giganews.com!nntp.giganew
s.com!local01.nntp.dca.giganews.com!nntp.is.co.za! news.is.co.za.POSTED!not-f
or-mail
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:113013
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| HI,
| This is realy a stupid problem but I cannot find a solution, please help.
| I have a asp.net page that displays after a user has logged on to the
| system. On this page is a couple of options and depending which option, a
| different asp page opens when a BUTTON IS CLICKED. I would like to know
how
| to progrm the button so that a new browser window opens and not close the
| previous one. In the old HTML it was easy, I just used _blank and there
you
| go. I am using VB on my asp page.
|
| Thanks
| Elmo
|
|
|

Nov 19 '05 #2
You can open windows with the javascript window.open method. This includes
options for sizing the window and making various toolbars and menus
visible/invisible.
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
"elmo" <el**@delphisure.com> wrote in message
news:Zv********************@is.co.za...
HI,
This is realy a stupid problem but I cannot find a solution, please help.
I have a asp.net page that displays after a user has logged on to the
system. On this page is a couple of options and depending which option, a
different asp page opens when a BUTTON IS CLICKED. I would like to know
how to progrm the button so that a new browser window opens and not close
the previous one. In the old HTML it was easy, I just used _blank and
there you go. I am using VB on my asp page.

Thanks
Elmo

Nov 19 '05 #3
I just read this message in regards to popup blockers. So are you saying that
possibly, if I'm using WinXP-SP2, and the RegisterStartupScript opens a brand
new ASP.Net page, the popup blocker thats inherent in XP won't allow it?

Whats the alternative? I need some code on my first page to execute, and
then when its done executing, I need to open a new page. I tried adding an
Onclick attribute but that runs first.

"Steve C. Orr [MVP, MCSD]" wrote:
You can open windows with the javascript window.open method. This includes
options for sizing the window and making various toolbars and menus
visible/invisible.
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
"elmo" <el**@delphisure.com> wrote in message
news:Zv********************@is.co.za...
HI,
This is realy a stupid problem but I cannot find a solution, please help.
I have a asp.net page that displays after a user has logged on to the
system. On this page is a couple of options and depending which option, a
different asp page opens when a BUTTON IS CLICKED. I would like to know
how to progrm the button so that a new browser window opens and not close
the previous one. In the old HTML it was easy, I just used _blank and
there you go. I am using VB on my asp page.

Thanks
Elmo


Nov 19 '05 #4
there is no alternative. the openwindow must be tied to the onclick event,
foe the popup blocker to allow it. you can move the postback logic to the
popup window. you could change the form target to a new window (must be done
in client code to trick asp.net).
-- bruce (sqlwork.com)


"klynn" <kl***@discussions.microsoft.com> wrote in message
news:D6**********************************@microsof t.com...
I just read this message in regards to popup blockers. So are you saying
that
possibly, if I'm using WinXP-SP2, and the RegisterStartupScript opens a
brand
new ASP.Net page, the popup blocker thats inherent in XP won't allow it?

Whats the alternative? I need some code on my first page to execute, and
then when its done executing, I need to open a new page. I tried adding an
Onclick attribute but that runs first.

"Steve C. Orr [MVP, MCSD]" wrote:
You can open windows with the javascript window.open method. This
includes
options for sizing the window and making various toolbars and menus
visible/invisible.
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
"elmo" <el**@delphisure.com> wrote in message
news:Zv********************@is.co.za...
> HI,
> This is realy a stupid problem but I cannot find a solution, please
> help.
> I have a asp.net page that displays after a user has logged on to the
> system. On this page is a couple of options and depending which option,
> a
> different asp page opens when a BUTTON IS CLICKED. I would like to know
> how to progrm the button so that a new browser window opens and not
> close
> the previous one. In the old HTML it was easy, I just used _blank and
> there you go. I am using VB on my asp page.
>
> Thanks
> Elmo
>


Nov 19 '05 #5

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

Similar topics

2
by: | last post by:
>> When I open a second browser window from the first, it uses the same session with first!!! > This is not true. session_id is unique for each combination of browser/url. I believe this too,...
13
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to...
20
by: msa | last post by:
Hi there, First off, let me say that I know that launching to full screen is a bad idea. I would never do it given the choice, but I must follow orders from my boss, the boss that desparately...
12
by: Kepler | last post by:
How do you get the height of the client browser in IE? Both document.body.clientHeight and document.body.offsetHeight return the height of the document. If the page is long and there's a vertical...
33
by: randau | last post by:
Linking to a Targeted Browser Window I'd like to open reference links to other web sites in a separate browser window from the browser window hosting my own web site pages. The Link Target...
6
by: G Dean Blake | last post by:
in my aspx app I am writing a stream that works fine but it replaces what is in the client browser window. The code is as follows: .. .. HttpContext.Current.Response.ClearHeaders()...
3
by: Scott | last post by:
I wish to have a link on a page that launches a new browser before it loads the target link. The standard _new and _blank include the parent browser's cookies. Is there an alternative method that...
6
by: hemant.singh | last post by:
Hi all, I am trying to get a way by which I'll know exactly when user goes out of my site by clicking on close button in browser, So that w/e user click close button in browser, I can send a...
0
by: toeffetommy | last post by:
Hello, I need a piece of functionality developed for our Website and I need some technical advice on how get there. Essentially, what I want to develop is a browser-within-browser...
3
by: Jimmy | last post by:
Is it possible to open a pop-up browser window (modal-style) inside another browser? e.g. // assuming something is calling this function inside the html as some event got triggered function...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.