Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2004, 02:39 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default Maximising the browser window in code


Hi,

   I have written a simple ASP.NET form using VB.NET. When my
.aspx default page first comes up under the browser (MS IE5) it is
not fully maximised and I have to click on the browser maximise button.

Is there any way I can get the .aspx form to maximise using
VB code?

Any and all help much appreciated.
Cheers
Chas, Canterbury UK
 
Old June 9th, 2004, 02:49 AM
Authorized User
 
Join Date: May 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

A simple way would be to use javascript and run a function on the onload of the body tag.
EG
<script>
function Maximise(){
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height);
}
</script>
<body onload="Maximise()">
 
Old June 9th, 2004, 06:42 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Where in the page HTML do I put this code?
Do I need to specify that the code is javascript and not vbscript?
If so - how?

So to be dumb but I dont know HTML well.
 
Old June 9th, 2004, 11:32 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

But remember, Maximised or Minimised Window of Browser is not part of ur page! so dont waste time for that things.
Its my opinion.

Always:),
Hovik Melkomian.
 
Old June 10th, 2004, 11:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

You can put javascript in the head, or between the head and body tags, as an option. It's pretty flexible.

<head>
...
<script>
...
</script>
</head>

</head>
<script>
...
</script>
<body>

You may even be able to put in the body, although I never do.

Brian
 
Old June 10th, 2004, 11:20 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Yes, you can put JavaScript anywhere in an HTML document (or ASP, or PHP, etc.), although to have a valid page you would put it within the <html> tags.

Chris' function should work, but it doesn't always actually maximize the window. It just makes it span the width and height of the screen. Usually the maximize button will still be maximize, not minimize. But if it's close enough that you don't care, fine with me.

This code opens an absolutely fullscreen window:

<script type=text/javascript language=javascript>
var nw = window.open('yourpage.asp','nw','fullscreen');
</script>

Notice that I did specify the language and script of the <script> tag, although it is not usually necessary with JavaScript. I believe there's a <meta> tag that allows you to define the default scripting language.

HTH,

Snib

<><
 
Old June 11th, 2004, 03:59 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks guys - that helps me greatly - Chas





Similar Threads
Thread Thread Starter Forum Replies Last Post
open new browser window rocksbhavesh ASP.NET 1.0 and 1.1 Basics 2 July 19th, 2007 07:34 AM
Open new browser window amatytfc ASP.NET 2.0 Basics 2 February 22nd, 2007 06:03 AM
Close Browser Window MoisesZaragoza Javascript How-To 2 February 6th, 2007 08:02 PM
File Browser window Figgis Access 2 November 20th, 2005 01:49 PM
Launch default browser in a new browser window haiying Beginning VB 6 1 August 30th, 2005 05:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.