Link to home
Start Free TrialLog in
Avatar of Jon Winterburn
Jon WinterburnFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Datagrid style is screwed on IIS 6

Hi experts,

I have a really irritating CSS/datagrid problem. I am developing an ASP.NET page in VB.NET on XP SP3 with VS.NET 2005. When I view the page on my machine, the datagrid looks perfect (see attachment 1). But when I copy the EXACT files to the production server (Windows Server 2003 standard, SP2) the datagrid looks ugly (thicker grey lines) and the header breaks (see attachment 2). I am viewing both in IE8 on the same machine.

Why is this happening?! Is there something about IIS6 that displays datagrids differently to IIS5?

Thanks

Jon
attachement1.jpg
attachement2.jpg
Avatar of Si_Hibbard
Si_Hibbard
Flag of United States of America image

IIS won't effect the CSS or rendering of the datagrid, it just serves the files. The .Net framework will compile and generate the markup.

I wonder if it is caching the CSS file - maybe you are seeing a previous version. Is the CSS in a separate file - try deleting it, should see no style.

Unless you are styling it all inline in the code.
Avatar of Jon Winterburn

ASKER

I have removed my custom CSS and left the datagrid as such:

asp:datagrid ID="dgCurrYear" runat="server" AutoGenerateColumns="False" CellPadding="3" ForeColor="#333333" Width="300" style="border-collapse:collapse"

But yet, the ugly gridlines are there, rather than the clean, thinner, lighter ones.
I have just discovered something else. If I visit my own local machine from another machine, the datagrid looks broken! So it would appear that if I view it locally, it looks like I expect it to, but if I visit it remotely, the formatting is screwed. I have confirmed this by putting a copy of the site on another machine and performing the same tests.

Is there a setting in IIS or .NET that is causing this to happen?
That sounds very odd.

So what happens if you make the border colour red for example - what do you see local and remote?
ASKER CERTIFIED SOLUTION
Avatar of Jon Winterburn
Jon Winterburn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Crikey what a pain. I didn't know it could be set depending on network type. Well I'm glad you found the problem that's a tough one to learn :)