?
Solved

How do I get my page to maximize when it opens?

Posted on 2006-04-16
9
Medium Priority
?
866 Views
Last Modified: 2008-01-09
Hi,

I'm using Visual Studio ASP.NET 2005.  How do I get my page to maximize when it opens?

Thanks,
Denise
0
Comment
Question by:DeniseGoodheart
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 2

Expert Comment

by:asdavey
ID: 16466408
Do you mean how do you get the browser to maxmize when someone visits your site?
0
 
LVL 5

Assisted Solution

by:bullrout
bullrout earned 960 total points
ID: 16466435
Hi There,

If you are talking about a window then you could use something like this.

in the body using onload you can call a function:

<BODY  onload="MaxWindow ();" >

then in the head of the document you can place the javascript function itself:

<SCRIPT language="JavaScript">
      function MaxWindow ()
      {
        window.resizeTo(screen.availWidth,screen.availHeight);
        window.moveTo(0,0);
      }
</SCRIPT>

This will allow the window to maximise when opening. Hope this helps

Sean


0
 

Author Comment

by:DeniseGoodheart
ID: 16466456
Hi,

I would like to use VB.NET in the ASP.NET Page_Load event to have the page appear as maximize.

Thanks,
Denise
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 5

Expert Comment

by:bullrout
ID: 16466468
You want the window to maximise when loaded, is that correct?
0
 
LVL 2

Expert Comment

by:asdavey
ID: 16466486
The page can't be maximised using VB.Net because VB.Net executes on the server side. The maximisation has to occur on the client side, so javascript is your best answer.
0
 
LVL 5

Expert Comment

by:bullrout
ID: 16466493
hi,

use the RegisterStartupScript method to place the code inside the Page_Load event.

Sean

0
 
LVL 7

Assisted Solution

by:irps20001
irps20001 earned 80 total points
ID: 16467397
Write a javascript function and run that funciton on load.

Your aspx page
[CODE]

function maximizeWindow() {
      window.moveTo(0,0);
      window.resizeTo(screen.width,screen.height);
}


      <body leftMargin="0" topMargin="0" onload="maximizeWindow();" marginwidth="0" marginheight="0">
[/CODE]

Code is similar to what bullrout is given above, i just added window.moveTo(0,0);
Rest are all same except screen.availWidth,screen.availHeight.
Credit goes to bullrout

0
 
LVL 12

Accepted Solution

by:
bsdotnet earned 960 total points
ID: 16467659
Add this in your page_load, (modified based on bullrout's comments)
        Dim cscript = ""
        cscript = "<script language=JavaScript>window.moveTo(0,0);window.resizeTo(screen.availWidth,screen.availHeight);</script>"
        ClientScript.RegisterClientScriptBlock(Me.GetType(), "cscript", cscript)
0
 

Author Comment

by:DeniseGoodheart
ID: 16483254
Hi All,

I learned a lot  with all your great help.

Many Thanks,
Denise
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question