Click here to Skip to main content
15,903,201 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am creating a web page using Asp.net. I want to set my resolution as 1027*768.
I have tried with all the options but not getting set.
1) I used "%" to set width and height for my Div, Table, etc. The issue was if i use the "%", if I dont have any content in the Div than the height I specified will not get affect.
Following is the code which i have the written for Master page

C#
<table height="100%" width="100%">
            <tr>
                <td align="center" height="10%" width="100%">
                    <asp:Label ID="header" runat ="server" Text ="Header Part"> </td>
            </tr>
            
            <tr>
                <td align="center" height="5%" width="100%">
                    <asp:Label ID="Menu" runat ="server" Text ="Menu Part"> </td>
            </tr>
            
            <tr>
                <td height="75%" width="100%">
                    <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
                    
                </td>
            </tr>
            
            <tr>
                <td align="center" height="10%" width="100%">
                   <asp:Label ID="Footer" runat ="server" Text ="Footer Part"> </td>
            </tr>
        </table>
Posted
Updated 14-Mar-12 20:36pm
v3
Comments
Ajith The Great 14-Mar-12 9:20am    
Does The Aspx Page Which you have created contains Master Page .. ?
Asif Iqbal A.Khan 15-Mar-12 0:41am    
Ya i do have a Master Page..
Sergey Alexandrovich Kryukov 14-Mar-12 13:37pm    
Why? why?!
--SA
Anuja Pawar Indore 15-Mar-12 2:36am    
Added code block
Asif Iqbal A.Khan 16-Mar-12 8:47am    
the code block which u have added i unable to see that..

Don't do it. This is now HTML works. Just the opposite: you page should work well enough no matter what page size your user would make. If you do anything else, your page simply has no value. Who would ever want to use it?

—SA
 
Share this answer
 
try like this

XML
<div style="height: 100%; width: 50%;">
        hi
    </div>
 
Share this answer
 
Comments
Asif Iqbal A.Khan 15-Mar-12 0:43am    
I have tried with that also, but the problem here is, it will occupies the space only when it has some control, else it will just shrink.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900