Solved

Controlling the web browser screen height and width

Posted on 2012-04-06
11
265 Views
Last Modified: 2012-04-29
Hello,

I want to write a simple asp.net app. I have my default page where I will put my details. However, when it loads, I do not want to be shown in full screen of the browser. Instead it should be in a controlled manner. Lets say I want the browser to be resized to 800x600(just like you have popups). Is there a way to control this?


Thanks
0
Comment
Question by:DoubtMan
  • 3
  • 3
  • 3
  • +2
11 Comments
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 37819728
No.  You are running in a sandbox that allows only read-only access to such attributes.  With a JavaScript popup window you can set the height width however most people block popups because they can be dangerous and are definitely annoying.
0
 
LVL 26

Expert Comment

by:Shaun Kline
ID: 37820267
If you are only concerned that your details do not stretch, you could wrap your details in a DIV tag and give the tag a defined width.
0
 

Author Comment

by:DoubtMan
ID: 37820570
Hi Shaun,
Yes my concern is only for details not to stretch. Shaun can you please elaborate a bit or script that for me so that I know how that can be accomplished?

Thanks.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 37820614
If you are working in ASP.NET then use a Panel tag and set the width attribute.  The Panel is converted to a DIV in ASP.NET.
0
 
LVL 16

Expert Comment

by:Kamal Khaleefa
ID: 37820712
also you can use a table with fix size or use a gridview whith fiz size

Regards
0
 
LVL 26

Expert Comment

by:Alan Warren
ID: 37821036
An Ajax ModalPopup is totally resizable and doesn't alarm popup blockers.
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx

Respectfully yours,
Alan
0
 
LVL 26

Expert Comment

by:Shaun Kline
ID: 37821093
As tedbilly said, a Panel control will work. If you have web accessibility concerns try to avoid using a table for layout purposes, as it requires additional configuration so that screen readers can handle them.
0
 

Author Comment

by:DoubtMan
ID: 37837807
For some reason I couldnt get this work to my favour.

Can somebody please tell me how to put a table that will have a fixed size on the browser(not matter what screen size it is). Lets say I want a table always having 800x600 size. ?
0
 
LVL 26

Expert Comment

by:Shaun Kline
ID: 37845452
Try this:
<table width="800">
<tr height="600">
<td width="100%"><!-- Content Here --></td>
</tr>
</table>
0
 
LVL 51

Accepted Solution

by:
Ted Bouskill earned 500 total points
ID: 37847525
You have to add style='table-layout:fixed' otherwise the table can grow.  The width and height are actually "minimum" values, not guaranteed to stay that size if you put an image larger than 800 it will grow bigger unless you use the style setting I provided.
0
 

Author Closing Comment

by:DoubtMan
ID: 37907951
Thanks. The key was setting up the table to fixed.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

770 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