473,385 Members | 1,934 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.

new "windows" in .NET

Does anyone have any ideas how to open a new web browser
window in .NET?

I'm using ASP.NET with VB as the code behind, and after
some (server side) validation code may need to open a
second browser window.

Any help gratefully received.

Cheers
Stu.

Nov 17 '05 #1
10 1894
AW
You do just like you would in HTML: put a client-side script with a
windows.open(...) command.

ASP.Net doesn't provide you with anything new on that side.
--
To reply, remove a "l" before the @ sign.

Arnaud Weil - MCT, MCSD.Net, MCAD.Net
Nov 17 '05 #2
In your codebehind after the validation write the
javascript to open the window to a literal control.

litScript.Text = "<script
type=""text/javascript"">window.open('somepage.aspx');
</script>"
-----Original Message-----
Does anyone have any ideas how to open a new web browser
window in .NET?

I'm using ASP.NET with VB as the code behind, and after
some (server side) validation code may need to open a
second browser window.

Any help gratefully received.

Cheers
Stu.

.

Nov 17 '05 #3

Hi,

Thanks for the reply.

I already knew of the windows.open() command, but I don't
know of a way that I can invoke this from my VB code.

Is there a way to invoke the java script from the VB
server side code?

Cheers
Stu.
-----Original Message-----
You do just like you would in HTML: put a client-side script with awindows.open(...) command.

ASP.Net doesn't provide you with anything new on that side.--
To reply, remove a "l" before the @ sign.

Arnaud Weil - MCT, MCSD.Net, MCAD.Net
.

Nov 17 '05 #4
AW
> I already knew of the windows.open() command, but I don't
know of a way that I can invoke this from my VB code.

Is there a way to invoke the java script from the VB
server side code?


In your CodeBehind, write:
RegisterClientScriptBlock("<script>window.open(... )</script>");
--
To reply, remove a "l" before the @ sign.

Arnaud Weil - MCT, MCSD.Net, MCAD.Net
Nov 17 '05 #5

Thanks, that is exactly the kind of functionality I was
looking for.

With a bit of thought I can now achieve my goal.

Cheers
Stu.
-----Original Message-----
In your codebehind after the validation write the
javascript to open the window to a literal control.

litScript.Text = "<script
type=""text/javascript"">window.open('somepage.aspx');
</script>"
-----Original Message-----
Does anyone have any ideas how to open a new web browser
window in .NET?

I'm using ASP.NET with VB as the code behind, and after
some (server side) validation code may need to open a
second browser window.

Any help gratefully received.

Cheers
Stu.

.

.

Nov 17 '05 #6
Hi Stuart,

An ASP.Net application is just HTML on the client side. Therefore, the way
to open a new browser window is still the same. You can do it either by
using the "target" attribute of a hyperlink or form, or you can use
JavaScript's window.open() method to do so. In either case, it has to be
done on the client browser, not on the server (other than, for example,
using Page.RegisterStartupScript() to add your JavaScript to the page).

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Stuart Brierley" <br*************@hotmail.com> wrote in message
news:0d****************************@phx.gbl...
Does anyone have any ideas how to open a new web browser
window in .NET?

I'm using ASP.NET with VB as the code behind, and after
some (server side) validation code may need to open a
second browser window.

Any help gratefully received.

Cheers
Stu.

Nov 17 '05 #7
M K
Okay, what would you say if I want this page to open a new
window and THEN go to a different page itself?
-----Original Message-----
In your codebehind after the validation write the
javascript to open the window to a literal control.

litScript.Text = "<script
type=""text/javascript"">window.open('somepage.aspx');
</script>"


Nov 17 '05 #8
AW
> Okay, what would you say if I want this page to open a new
window and THEN go to a different page itself?


litScript.Text = "<script>window.open('somepage.aspx');
window.location='otherpage.aspx'</script>"

This kind of question would be better asked on a JavaScript forum...
--
To reply, remove a "l" before the @ sign.

Arnaud Weil - MCT, MCSD.Net, MCAD.Net
Nov 17 '05 #9

The example supplied below opens the new window when the
original page "reloads".

In my application I have a small java function which I
call (rather than directly calling window.open()).

Could you not set the literal to call a java function
which first calls window.open and then redirects the
original page itself?

Would that work?

Cheers
Stu.
-----Original Message-----
Okay, what would you say if I want this page to open a newwindow and THEN go to a different page itself?
-----Original Message-----
In your codebehind after the validation write the
javascript to open the window to a literal control.

litScript.Text = "<script
type=""text/javascript"">window.open('somepage.aspx');
</script>"


.

Nov 17 '05 #10

http://www.metabuilders.com/Tools/DialogWindow.aspx
-----Original Message-----
Does anyone have any ideas how to open a new web browser
window in .NET?

I'm using ASP.NET with VB as the code behind, and after
some (server side) validation code may need to open a
second browser window.

Any help gratefully received.

Cheers
Stu.

.

Nov 17 '05 #11

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

Similar topics

11
by: Codemonkey | last post by:
Hi, I am writing an App in .Net that involves some scheduling of tasks. I was wondering if anybody has come accross any components or examples of how to implement a schedule manager like the one...
2
by: ~dr-sci-fi | last post by:
hi all, i want to use "Windows Picture Viewer and Fax Viewer" in my c# app to manipulate images, picture viewer is found as a DLL (shimgvw.dll) in System32 folder of WinXP. can some one tell...
2
by: unknown | last post by:
I compiled as following (e.g) cl first.cpp but following message ↓ Cannot open include file "windows.h" :Such a file or directory What compile option is used in dotnetframework SDK 1.1 or...
4
by: Dean Slindee | last post by:
I would like to provide a menu item that the users can click that launches the same "Windows Security" window that doing a Ctrl+Alt+Delete launches, but thru a Process.Start. Is this possible, and...
4
by: parsifal | last post by:
Hi, I'm wondering how you can use the standard C# library to get the "windows" directory? (e.g. "c:/windows"). I need to specify the location of a config file in a service, and I don't want to...
2
by: domtam | last post by:
Hi there. My goal is to write a windows service that can act as HTTP Request server. How can I do that? I know that I can use ASP.NET to develop a web site to achieve this purpose, i.e....
0
by: lisseut | last post by:
Hi, hope I'm posting to the right forum. I'm using C# under .NET 1.1, Windows XP SP2 I have a form and I've overridden WndProc to print to a text box whenever it receives the WM_NCMOUSELEAVE...
2
by: djoefish | last post by:
sequel to the topic "install patch on windows"..... I am currently running Python2.3 with Enthought on a windows PC. I have been running into a memory problem (see...
2
by: ezageza | last post by:
Hi, does anyone know whats going on or how to fix my problem with windows media player 10. When i'm finished using it and am shutting it down it brings up a message saying something like 'windows...
4
by: tvnaidu | last post by:
How can I cheack CPU load on LINUX like "Windows Task manager" on Windows?. Windows task manager shows CPU load (percentage) and etc, any tool in LINux?. I know "top" command which shows which...
1
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.