?
Solved

form width and height in asp.net

Posted on 2011-03-21
7
Medium Priority
?
2,547 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
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 2000 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

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

649 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