Solved

asp:Table renders differently in VS2008 than IIS 6.0

Posted on 2011-03-01
9
510 Views
Last Modified: 2012-05-11
I have a couple of asp:tables (one is attached, the other is very similar). This centers the tables in the Visual Studio development server but not in IIS 6.0 in my demo/staging server. In VS2008, the tables are centered; in IIS 6.0 it seems to ignore the Left specification in the style attribute.

Thanks!

Gary
<table cellspacing="5px" width="60%" border="2px" style="left:20%; position:relative">
            <tr>
                <td align="right"><asp:Label ID="nameLabel" runat="server" Text="Logged In User:"  /></td>
                <td align="left"><asp:TextBox ID="nameTB" runat="server" ReadOnly="true" CssClass="userName" /></td>
            </tr>
        </table>

Open in new window

0
Comment
Question by:gmsteele44
  • 4
  • 3
  • 2
9 Comments
 
LVL 9

Expert Comment

by:gdupadhyay
ID: 35011021
Try this


           
<table cellspacing="5px" width="60%" border="2px"  style="left:20%; position:relative; z-index: auto;">
            <tr>
                <td align="right"><asp:Label ID="nameLabel" runat="server" Text="Logged In User:"  /></td>
                <td align="left"><asp:TextBox ID="nameTB" runat="server" ReadOnly="true" CssClass="userName" /></td>
            </tr>
        </table>

Open in new window

0
 
LVL 16

Expert Comment

by:Kamal Khaleefa
ID: 35011050
try to change left:20%
to padding-left:50px;

then change the value of the 50 px based on ur requirement
0
 
LVL 9

Expert Comment

by:gdupadhyay
ID: 35011157
Its working in both case. are you using any parent control (like table to div)?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:gmsteele44
ID: 35012688
The table is inside a div with style horizontal-align:Center. Neither of the above solutions is working in IIS. They do work in VS development server, as does my original code. I'm wondering if there is a setting in IIS 6.0 that affects this? Or a .NET service pack? I believe my server is fully up to date but I may have missed something.
0
 

Author Comment

by:gmsteele44
ID: 35013252
Here is a shot of the bad rendering (IIS 6.0) (bad.png) and the good one (Visual Studio 2008 Dev server) (good.png).
 Rendered from IIS 6.0 on Win2003 Rendered from VS2008 on Win7
0
 
LVL 16

Expert Comment

by:Kamal Khaleefa
ID: 35014771
try to make border=1 for your table
and then start to edit the values of padding , align ..etc
once u put border =1 it can help u determine what to do
and why the table is missed
0
 
LVL 9

Assisted Solution

by:gdupadhyay
gdupadhyay earned 250 total points
ID: 35016290
It is not related to IIS or any service pack. Its basic HTML error.
Can you post the more design code (Atleast upper portion of page) ?
0
 

Accepted Solution

by:
gmsteele44 earned 0 total points
ID: 35018819
It turned out to be compatibility mode. It was turned on for intranet sites. When I turned it off, rendering was normal.

Thanks for all the suggestions!
0
 

Author Closing Comment

by:gmsteele44
ID: 35067734
Everyone was very helpful with plenty of good suggestions.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now