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

How to open a new browser window in ASP.net?

Hello,

i have an ASP.net page with a button. When the button is clicked i want to
open a new Browser window (400x200px) having only the title bar and nothing
else.This browser window would load newpage.aspx in it.

I would also like to know how to create a button to insert in newpage.aspx
and that would close that same window.

I have no idea of how to do this and until now i didn't find some
information that might help me out.

I am working in ASP.net / VB

Thank You,
Miguel
Nov 20 '05 #1
6 5827
Cor
Hi Miguel

Do you use Visual Studio?

Cor
i have an ASP.net page with a button. When the button is clicked i want to
open a new Browser window (400x200px) having only the title bar and nothing else.This browser window would load newpage.aspx in it.

I would also like to know how to create a button to insert in newpage.aspx
and that would close that same window.

I have no idea of how to do this and until now i didn't find some
information that might help me out.

I am working in ASP.net / VB

Nov 20 '05 #2
Cor
Hi Miguel

Do you use Visual Studio?

Cor
i have an ASP.net page with a button. When the button is clicked i want to
open a new Browser window (400x200px) having only the title bar and nothing else.This browser window would load newpage.aspx in it.

I would also like to know how to create a button to insert in newpage.aspx
and that would close that same window.

I have no idea of how to do this and until now i didn't find some
information that might help me out.

I am working in ASP.net / VB

Nov 20 '05 #3
To open a new window as you want try this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Response.Write("<script>window.open('prova.asp','_ new',
'width=400,height=200');</script>")
End Sub
Refer to javascript function window.open to change what's displayed or not
(the 3rd parameter is window opstion)

To close the window add the button (I used ImageButton) and on page load add
imgbtClose.Attributes("onclick") = "javascript:window.close();"
or
imgbtClose.Attributes.Add("onclick", "javascript:window.close();")
Hope this help
Nicola Garone
"Miguel Dias Moura" <in************@27lamps.com> ha scritto nel messaggio
news:ei**************@TK2MSFTNGP09.phx.gbl...
Hello,

i have an ASP.net page with a button. When the button is clicked i want to
open a new Browser window (400x200px) having only the title bar and nothing else.This browser window would load newpage.aspx in it.

I would also like to know how to create a button to insert in newpage.aspx
and that would close that same window.

I have no idea of how to do this and until now i didn't find some
information that might help me out.

I am working in ASP.net / VB

Thank You,
Miguel

Nov 20 '05 #4
To open a new window as you want try this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Response.Write("<script>window.open('prova.asp','_ new',
'width=400,height=200');</script>")
End Sub
Refer to javascript function window.open to change what's displayed or not
(the 3rd parameter is window opstion)

To close the window add the button (I used ImageButton) and on page load add
imgbtClose.Attributes("onclick") = "javascript:window.close();"
or
imgbtClose.Attributes.Add("onclick", "javascript:window.close();")
Hope this help
Nicola Garone
"Miguel Dias Moura" <in************@27lamps.com> ha scritto nel messaggio
news:ei**************@TK2MSFTNGP09.phx.gbl...
Hello,

i have an ASP.net page with a button. When the button is clicked i want to
open a new Browser window (400x200px) having only the title bar and nothing else.This browser window would load newpage.aspx in it.

I would also like to know how to create a button to insert in newpage.aspx
and that would close that same window.

I have no idea of how to do this and until now i didn't find some
information that might help me out.

I am working in ASP.net / VB

Thank You,
Miguel

Nov 20 '05 #5
you can do this in javascript

function fnLoadNewWindow(strUrl)
{
window.open(strUrl,null,"height=200,width=400,stat us=no,toolbar=no,menubar=no,location=no");
}

<input type="button" onclick="fnLoadNewWindow('newpage.aspx');" />

you can also use onclick="window.close();" to close the popup later.
Miguel Dias Moura wrote:
Hello,

i have an ASP.net page with a button. When the button is clicked i want to
open a new Browser window (400x200px) having only the title bar and nothing
else.This browser window would load newpage.aspx in it.

I would also like to know how to create a button to insert in newpage.aspx
and that would close that same window.

I have no idea of how to do this and until now i didn't find some
information that might help me out.

I am working in ASP.net / VB

Thank You,
Miguel

Nov 20 '05 #6
you can do this in javascript

function fnLoadNewWindow(strUrl)
{
window.open(strUrl,null,"height=200,width=400,stat us=no,toolbar=no,menubar=no,location=no");
}

<input type="button" onclick="fnLoadNewWindow('newpage.aspx');" />

you can also use onclick="window.close();" to close the popup later.
Miguel Dias Moura wrote:
Hello,

i have an ASP.net page with a button. When the button is clicked i want to
open a new Browser window (400x200px) having only the title bar and nothing
else.This browser window would load newpage.aspx in it.

I would also like to know how to create a button to insert in newpage.aspx
and that would close that same window.

I have no idea of how to do this and until now i didn't find some
information that might help me out.

I am working in ASP.net / VB

Thank You,
Miguel

Nov 20 '05 #7

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="#"...
10
by: David McCulloch | last post by:
The following code opens a new window, but the "resizeTo" doesn't resize it. Why not? (Don't ask why I simply did not open the window with the new size....my original problem was how to open a...
2
by: nntp | last post by:
Are there other ways to open multile windows at once? <SCRIPT language="JavaScript"> function open1() { var open1 = window.open('http://google.com/CheckEnviro.pl','','scrollbars=yes,height=600...
29
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the...
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...
6
by: Mateo | last post by:
Hi! I tried to open page in new window with window.open(...) method. open() method supports fullscreeen mode, but I would like to open new maximized window with tiltle bar only.... Any idea...
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...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.