?
Solved

How to open my webform maximized

Posted on 2005-05-15
7
Medium Priority
?
767 Views
Last Modified: 2011-09-20
when I open the first webform in my web site it opens in a reduced form.how can i open it maximized automatically. please send me the code in VB.NET
Thanks
0
Comment
Question by:fmichail
  • 4
  • 2
7 Comments
 
LVL 9

Expert Comment

by:riyasjef
ID: 14008101
Just insert this script in your aspx file...

<script language="JavaScript1.2">
top.window.moveTo(0,0);
if (document.all)
   { top.window.resizeTo(screen.availWidth,screen.availHeight); }
else if
   (document.layers || document.getElementById)
   {
   if
    (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth)
     { top.window.outerHeight = top.screen.availHeight;
       top.window.outerWidth = top.screen.availWidth; }
   }
</script>

RJ
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 14008290
u cannot open a webform in a maximized format .. there is no such property for a window or a document ... the above code will still keep it in the normal form, but exapnd it to so that it uses the available space in the screen and makes it look as if it has been maximised ... BTW, The IE browser retains the last position and state of the browser when it last used .. so if ur last browser's winsdow state was maximised, then the next session would also be maximised ... so it seems that the problem you are facing might be because you are using window.open in ur first page to open another window ... if thats the case .. then u could use the features to assign the property to the new window

window.open newPage.aspx, "Left=0,Top = 0, status=no, menu=no, location=no, resizable=yes, titlebar=no, toolbar=no,height=" & screen.availheight & ",width=" & screen.availwidth

0
 

Author Comment

by:fmichail
ID: 14012191
I start the project by an empty form used mainly to initialize variables then silently issues a command
request.redirect("myfirstPage.aspx")

this first page starts in a small form, and accordingly all the pages of the site will be within the same browser window.
The problem is how to run the project to display the first page (and accordingly the rest ofthe site) in full size.
Please, send me any server code in VB.net, otherwise Javascript for client side.
regards
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 26

Expert Comment

by:Rejojohny
ID: 14016286
>>I start the project by an empty form ..
is this maximized?
is ur browser IE? as i said .. it retains the size it was last closed in .. open a browser .. maximize it and then close it .. then all the latter browser windows opened will be in the mximized state .. there is no server side code for maximizing the broswer window .. use the javascript provided above to expand the browser window to the max available size in the screen (but not maximized)
0
 
LVL 9

Expert Comment

by:riyasjef
ID: 14016905
@Rejojohny

>> use the javascript provided above to expand the browser window to the max available size in the screen

This is what..actually happening when we maximize a window manually..right?
 
@fmichail

>>The problem is how to run the project to display the first page (and accordingly the rest ofthe site) in full size.

What u meant by "full size"?
Is it this  "status=no, menu=no, location=no, resizable=no, titlebar=no, toolbar=no,height=..." ?
If so ..impossible...
U can postion the first window..alss resize the window..but u can't hide the toolbars or menubars..
this is possible with "popup window" only..
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 14016994
>>This is what..actually happening when we maximize a window manually..right?
No .. maximized is a state in which the window is .. that is when we click on the maximize button of the window .. the one left to the close button ("X") .. i think that is what the author means ..
fmichail,
what u could do is .. instead of a redirect .. in the first page .. write this piece of code after all ur initial processing ...in the page load.. it will open a new window in expaded mode and close the first page ...

in the .vb file .. code-behind .. page load
dim lstrScript as string = "<script language = javascript>" & vbcrlf
lstrScript += "OpenNewForm();" & vbcrlf
lstrScript += "</script>;" & vbcrlf
page.RegisterStartupScript("OpenForm", lstrScript)

and in the aspx page .. deifne the function
<script language = javascript>
var screenheight = screen.availheight;
var screenWidth = screen.availwidth;
window.open(newPage.aspx, "Left=0,Top = 0, status=no, menu=no, location=no, resizable=yes, titlebar=no, toolbar=no,height=" + screenheight + ",width=" + screenWidth) ;
window.close();
</script>

0
 
LVL 26

Accepted Solution

by:
Rejojohny earned 500 total points
ID: 14017003
u can also open a new window in full screen mode .. use the "fullscree=yes" in the feature .. somethin like this
window.open('newpage.aspx', 'fullscreen=yes')

but i suppose this is supported by IE only

Also the above window.open should have been
<script language = javascript>
var screenheight = screen.availheight;
var screenWidth = screen.availwidth;
window.open('newPage.aspx', 'Left=0,Top = 0, status=no, menu=no, location=no, resizable=yes, titlebar=no, toolbar=no,height=' + screenheight + ',width=' + screenWidth) ;
window.close();
</script>


the quotes were not correct ...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Loops Section Overview
Suggested Courses

840 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