Solved

form width and height in asp.net

Posted on 2011-03-21
7
2,398 Views
Last Modified: 2012-05-11
Hi, I want to set width and height properties for  form1 in my asp.net page. I try this:
        #form1
        {
            height: 1070px;
            width: 1854px;
           overflow: hidden;
        }
and this:
<form id="form1" runat="server" style="overflow: hidden; height: 1070px; width: 1855px;">

in debugging mode on my computer it use size that I want, but after I copy page to iis 7 server code is not workin. What do I have to do to have it work on iis?

Thanks people.
0
Comment
Question by:kahvedzic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 7

Expert Comment

by:Maverick_Cool
ID: 35179588
please get page source from browser when you run from iis7
0
 
LVL 1

Author Comment

by:kahvedzic
ID: 35179660

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>
      test page
</title><link type="text/css" href="menu.css" rel="stylesheet" />
      <script type="text/javascript" src="jquery.js"></script>
      <script type="text/javascript" src="menu.js"></script>
    <style type="text/css">
        #outerdiv1
        {
            width:1300px;
            height:1110px;
            overflow:auto;
            top: 0px;
            left: -40px;
        }
        #inneriframe1
        {
            top:158px;
            left:530px;
            width:1280px;
            height: 1050px;
            margin-top:-50px;
            margin-left: -40px;
        }
        .style2
        {
            width: 2154px;
            height: 1247px;
        }
        .style3
        {
        }
        .style4
        {
            width: 585px;
        }
        .style6
        {
            width: 330px;
        }
        .style7
        {
            width: 300px;
        }
        #form1
        {
            height: 1070px;
            width: 1854px;
            overflow: hidden;
        }
        </style>
</head>
<body>
    <form method="post" action="" id="form1" style="overflow: hidden; height: 1070px; width: 1855px;">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMzk2MjA5ODMzZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAwUEVVNSUwUDREJTBQRORVRT3fH7EdORJzLmCjNGXPOpohWdukj1Su6Unkpay/8+AQA=" />
</div>
 
<div class="aspNetHidden">
 
      <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBAKNwa/4BgKbjZLcDgKn9u+FCgLI34WGA6jhHmcJTftEo3iPC1GHnB+HKDTEbI69IHlRktW3tR6N" />
</div>
    <table class="style2">
        <tr>
            <td class="style3" colspan="3">
      <div id="menu">
            <ul class="menu">
                  <li><a href="Default.aspx" class="parent"><span>1</span></a>
                  </li>
                  <li><a href="#"><span>2</span></a>
                        <div><ul>
                              <li><a href="3.aspx" class="parent"><span>3</span></a>
                              </li>
                              <li><a href="4.aspx" class="parent"><span>4</span></a>
                              </li>
                        </ul></div>
                  </li>
                  <li class="last"><a href="#"><span>5</span></a>
                  <div><ul>
                              <li><a href="6.aspx" class="parent"><span>6</span></a>
                              </li>
                              <li><a href="7.aspx" class="parent"><span>7</span></a>
                              </li>
                    <li><a href="8.aspx" class="parent"><span>8</span></a>
                              </li>
                    <li><a href="9.aspx" class="parent"><span>9</span></a>
                              </li>
                    <li><a href="10.aspx" class="parent"><span>10</span></a>
                              </li>
                    <li><a href="11.aspx" class="parent"><span>11</span></a>
                              </li>
                        </ul></div>
            </li>
            </ul>
      </div>
            </td>
        </tr>
        <tr>
            <td style="text-align: center" class="style7">
                <input type="image" name="USRS" id="USRS" src="images/USRS300x300.jpg" />
                <br />
                <br />
                <br />
                <input type="image" name="DBS" id="DBS" src="images/DBS-300x300.jpg" />
                <br />
                <br />
                <br />
                <input type="image" name="NETS" id="NETS" src="images/NETS%20300x300.jpg" />
                <br />
                <br />
                <br />
                <br />
                <br />
                <br />
                <br />
                <br />
            </td>
            <td style="text-align: center" class="style4">
            <div id='outerdiv1' align="center" style="z-index: 1">
            <iframe src="http://iis/display.aspx" id='inneriframe1'
                    scrolling="no" width="70%" frameborder="0"></iframe>
            </div></td>
            <td style="text-align: center" class="style6">
                <img id="Image4" src="images/zoom.JPG" style="position: relative; top: -182px; left: -292px; z-index: 2;" />
                <br />
                <br />
                <img id="Image5" src="images/scroll.jpg" style="position: relative; top: -147px; left: -292px; z-index: 1;" />
                <br />
            </td>
        </tr>
        <tr>
            <td style="text-align: center" class="style7">
                &nbsp;</td>
            <td style="text-align: center" class="style4">
                &nbsp;</td>
            <td style="text-align: center" class="style6">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: center" class="style7">
                &nbsp;</td>
            <td style="text-align: center" class="style4">
                &nbsp;</td>
            <td style="text-align: center" class="style6">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: center" class="style7">
                &nbsp;</td>
            <td style="text-align: center" class="style4">
                &nbsp;</td>
            <td style="text-align: center" class="style6">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: center" class="style7">
                &nbsp;</td>
            <td style="text-align: center" class="style4">
                &nbsp;</td>
            <td style="text-align: center" class="style6">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: center" class="style7">
                &nbsp;</td>
            <td style="text-align: center" class="style4">
                &nbsp;</td>
            <td style="text-align: center" class="style6">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: center" class="style7">
                &nbsp;</td>
            <td style="text-align: center" class="style4">
                &nbsp;</td>
            <td style="text-align: center" class="style6">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: center" class="style7">
                &nbsp;</td>
            <td style="text-align: center" class="style4">
                &nbsp;</td>
            <td style="text-align: center" class="style6">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: center" class="style7">
                &nbsp;</td>
            <td style="text-align: center" class="style4">
                &nbsp;</td>
            <td style="text-align: center" class="style6">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: center" class="style7">
                &nbsp;</td>
            <td style="text-align: center" class="style4">
                &nbsp;</td>
            <td style="text-align: center" class="style6">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="text-align: center" class="style7">
                &nbsp;</td>
            <td style="text-align: center" class="style4">
                &nbsp;</td>
            <td style="text-align: center" class="style6">
                &nbsp;</td>
        </tr>
        </table>
    </form>
    </body>
</html>

0
 
LVL 9

Expert Comment

by:mayank_joshi
ID: 35179696
you may try using style on <body> instead of <form>
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 52

Expert Comment

by:Carl Tawn
ID: 35179735
It works fine for me when run under IIS, the form is the dimensions specified. Maybe the problem lies elsewhere. Is the path to your stylesheet being resolved correctly for example?
0
 
LVL 1

Author Comment

by:kahvedzic
ID: 35179746
try that also and again same problem, working on localhost but not on iis.
0
 
LVL 10

Accepted Solution

by:
khan_webguru earned 500 total points
ID: 35180171
Hello bro,

above the form tag add this line......

<div  style="position:relative;overflow: hidden; height: '1070px'; width: '1855px';">
    <form>

and after closing the form tag close that div

  </form>
</div>


Its just warper of the form apply any style in "DIV" and set form style options like <form   style="position:relative;width:100%;height:100%;"> Hope this will get your desire result.

Regards,

Asif Ahmed Khan

0
 
LVL 1

Author Comment

by:kahvedzic
ID: 35180316
That was helpful. thanks. also problem was with css style of menu, that was always visible no mather what size of form and body I use. Thanks once more.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

737 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