473,387 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Visual studio 2005 HTML design view bugs

Hi,
I have had a lot of problems getting web pages, master pages and
content pages to render in VS2005 design view the same as they would in
Internet Explorer. I did a lot of looking on the internet for answers
but didn't have much luck. Anyway I believe I have found the causes of
the problems and thought I should share them in case any one else is
feeling the pain and also to find out what other peoples opinions are,
on whether these are bugs with VS2005 that should be fixed by
Microsoft.

************************************************** ****************
1. CSS incorrectly applied to Content and ContentPlaceHolder controls

VS2005 incorrectly applies CSS styles to asp:content and
asp:contentplaceholder controls in design view. As a result the design
view does not accurately display what will be rendered in the browser.

To recreate this problem do the following:
1. Create a simple stylesheet file called test.css
2. Place the following in the CSS file
td {
font-size: 25%;
background-color: #0AAE8B;
}
3. In VS2005 create a MasterPage with a single ContentPlaceHolder and a
<link> to the CSS file <link rel='stylesheet' href='test.css'
type='text/css'/>
4. Create a content page based on the created MasterPage
5. put some text in the in the asp:content control
6. Run the content page so that it can be viewed in Internet Explorer
7. In VS2005 view the content and MasterPage in design view

In VS2005 design view both the asp:content and asp:contentpalaceholder
have a bluish background and small font. However, when you run the
page in Internet Explorer the text is normal size and the background is
white.

I believe that this problem may be happening because the asp:content
and asp:contentplaceholder controls are being rendered as <table> for
display in VS2005 design view but they are not rendered at all when
output to Internet Explorer

This bug means that developers cannot see what the page will look like
without having to run it in Internet Explorer. It is possible to work
around the bug by modifying the <td> entry in the CSS file but the
problem with this is that the CSS file is set by the Marketing and web
teams which means it is not easily changed and if changed may break the
look and feel of older web apps.

************************************************** ************************************************** ******
2. Comments affect the display of the page

Putting a comment in front a <!DOCTYPE> tag causes the page to render
differently in Internet Explorer as opposed to VS2005 design view

To recreate do the following:

1. Create a simple stylesheet file called test.css
2. Place the following in the CSS file
body
{
font-size: 25%;
}

.ApplicationName {
background-color: #0F4E8A;
font-size: 400%;
color: #FFFFFF;
}
3. In VS2005 create a web page.
4. Put in the following <link> tag. <link rel='stylesheet'
href='test.css' type='text/css'/>
5. Put in the following tags
<table>
<tr>
<td class="ApplicationName">
aaaa
</td>
</tr>
</table>
6. Add the following comment after <%Page> but before <!DOCTYPE>
<!-- This is a comment that should affect nothing -->
7. Look at the page in VS2005 design view and then run it so that it is
viewed in Internet Explorer.
a. Notice that the text when displayed in Internet Explorer is much
larger than when viewed in VS2005 design view.
8. Move the comment below the <!DOCTYPE> tag
9. Look at the page in VS2005 design view and then run it so that it is
viewed in Internet Explorer.
a. Notice that the text is now the same when displayed in Internet
Explorer and VS2005 design view.

VS2005 design view and Internet Explorer 6 handle the html comment <!--
This is a comment that should affect nothing --> differently. I am not
sure which one is handling it correctly, but one of them is definitely
wrong.

************************************************** *******************************************
3. CssClass property of ASP controls is not accurately displayed

VS2005 design view does not render a page in the same way as Internet
Explorer when an ASP control with a "CssClass" property is inside a
html tag with a "class" attribute.

To recreate do the following:

1. Create a simple stylesheet file called test.css
2. Place the following in the CSS file
.ApplicationName {
background-color: #0F4E8A;
font-size: 200%;
color: #FFFFFF;
}
3. In VS2005 create a web page.
4. Put in the following <link> tag. <link rel='stylesheet'
href='test.css' type='text/css'/>
5. Put in the following tags
<p class="ApplicationName">
<asp:Label ID="Label1" CssClass="ApplicationName"
runat="server" Text="ApplicationName"></asp:Label>
</p>
6. Look at the page in VS2005 design view and then run it so that it is
viewed in Internet Explorer.
a. Notice that the text when displayed in Internet Explorer is much
smaller than when viewed in VS2005 design view.

It appears as if VS2005 design view is applying both the style
specified in "class" attribute and the style specified in the
"CssClass" attribute so that the text "ApplicationName" is displayed at
400%. Internet Explorer, however, applies only one of the styles so
that the text "ApplicationName" is displayed at 200%.

Once again I am not sure if it is VS2005 or Internet Explorer which is
correct but one of them is definitely wrong.

Thanks,

Jun 21 '06 #1
1 6306
In article <11**********************@r2g2000cwb.googlegroups. com>,
No********@hotmail.com writes
2. Comments affect the display of the page <snip>6. Add the following comment after <%Page> but before <!DOCTYPE>
<!-- This is a comment that should affect nothing -->
7. Look at the page in VS2005 design view and then run it so that
it is
viewed in Internet Explorer.
a. Notice that the text when displayed in Internet Explorer is much
larger than when viewed in VS2005 design view.


OK, I'm not 100% sure, but I think this isn't so much a bug, as due to
the way IE handles doctypes. Due to the fact that earlier versions of IE
had bugs with font sizes (amongst many other things), they introduced
"doctype sniffing" or "context switching" in IE6. This uses the doctype
to decide how to render the page. doctypes without an URL get rendered
in the old "quirks" mode, which was very inconsistent with the W3C
recommendations, and doctypes with an URL get rendered in the
"standards" mode, which is a lot closer to the W3C recommendations
(still jam-packed with bugs though!!).

AFAIK, IE uses the first line of the document as its test. If the first
line contains a doctype with an URL, it uses standards mode, otherwise,
it uses quirks mode. This means that adding a comment before the doctype
will switch it to quirks mode. As far as I remember, one of the
differences between the two is that the default font size in quirks mode
was larger (or was it smaller?).

You can test this with a simple stand-alone HTML document that uses
features that differ between the two modes. Add a comment before the
doctype and see if the rendering changes. I'm pretty certain it would.

This would explain your issue. The answer is simple - don't put comments
before the doctype!!

HTH

--
Alan Silver
(anything added below this line is nothing to do with me)
Jun 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Jacob Crossley | last post by:
Preface: Not to sound mean or arrogant, but please don't answer this question unless you have a specific and tested answer. I'm saying this only because I posted the same quesion earlier and got...
3
by: Steve Richter | last post by:
I have discovered that my web appl developed using the visual web developer 2005 freebie will not work on my godaddy.com web hoster. So I am using Visual Studio .Net 2003 Enterprise Architect...
4
by: Steve Richter | last post by:
using visual studio 2003 for my asp.net projects ... Once I undock the property window to get a better look at things, I cant dock it back where it came from. Can someone tell me how to redock...
4
by: Nathan Sokalski | last post by:
When editing an ASP Table, Visual Studio does not allow me to edit it in Design View. This makes it harder to add elements, because I must add every element either by using Design View to create...
11
by: Rolf Welskes | last post by:
Hello, the problem seems to be complex and is in all developments of web-controls which uses own TypeConverter. For this I have here a simple demo-program of the problem: The Control-code: A...
8
by: WT | last post by:
Is it normal that Visual Studio sets the PreInit handler for a Page from the OnInit code ? No chance to fire it as OnPreInit is run befor OnInit. ??? CS
7
by: Nathan Sokalski | last post by:
I am an ASP.NET developer, and Visual Studio 2005 seems to have stopped declaring the controls that I add in the *.designer.vb files, therefore forcing me to manually add them before I can use them...
1
by: bharathreddy | last post by:
This Article gives an introduction to VSTS Team Foundation & fundamental difference between Visual Source Safe (VSS) and VSTS Team Foundation. Team Foundation is a set of tools and technologies...
2
by: =?Utf-8?B?Um9iZXJ0IFNtaXRo?= | last post by:
Hi, I have just installed visual studio 2005 professional edition (evaluation version). However it will not allow me to view webforms in a website project in design view. I can just see the HTML...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.