Controlling the web browser screen height and width

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
DoubtManAsked:
Who is Participating?
 
Ted BouskillConnect With a Mentor Senior Software DeveloperCommented:
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
 
Ted BouskillSenior Software DeveloperCommented:
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
 
Shaun KlineLead Software EngineerCommented:
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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
DoubtManAuthor Commented:
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
 
Ted BouskillSenior Software DeveloperCommented:
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
 
Kamal KhaleefaInformation Security SpecialistCommented:
also you can use a table with fix size or use a gridview whith fiz size

Regards
0
 
Alan WarrenApplications DeveloperCommented:
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
 
Shaun KlineLead Software EngineerCommented:
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
 
DoubtManAuthor Commented:
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
 
Shaun KlineLead Software EngineerCommented:
Try this:
<table width="800">
<tr height="600">
<td width="100%"><!-- Content Here --></td>
</tr>
</table>
0
 
DoubtManAuthor Commented:
Thanks. The key was setting up the table to fixed.
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.

All Courses

From novice to tech pro — start learning today.