• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 852
  • Last Modified:

How to open my webform maximized

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
fmichail
Asked:
fmichail
  • 4
  • 2
1 Solution
 
riyasjefCommented:
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
 
RejojohnyCommented:
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
 
fmichailAuthor Commented:
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
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
RejojohnyCommented:
>>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
 
riyasjefCommented:
@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
 
RejojohnyCommented:
>>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
 
RejojohnyCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now