473,832 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ContentPlaceHol der controls

VS2005 incorrectly applies CSS styles to asp:content and
asp:contentplac eholder 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 ContentPlaceHol der 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:contentpala ceholder
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:contentplac eholder 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%;
}

.ApplicationNam e {
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="Applicat ionName">
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
.ApplicationNam e {
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="Applicat ionName">
<asp:Label ID="Label1" CssClass="Appli cationName"
runat="server" Text="Applicati onName"></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 "ApplicationNam e" is displayed at
400%. Internet Explorer, however, applies only one of the styles so
that the text "ApplicationNam e" 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 6347
In article <11************ **********@r2g2 000cwb.googlegr oups.com>,
No********@hotm ail.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
1783
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 spammed by this so-called Microsoft MVP that gave me a very vague answer, followed by a series of incorrect answers that I had already mentioned were tried, tested and failed. Sorry I had to start my post like that : - ) but here goes my actual...
3
1301
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 dated April 2004 from an expired MSDN subscription. Visual Studio .NET 2003, is that the latest Visual Studio for ASP.NET 1.1? Is there a service pack available for install? I dont see one on the Microsoft web site. The reason I ask is because...
4
1792
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 the property window? When I copy HTML snippets from another page the code behind class is not automatically updated with the new controls. For example, the Web Controls are not added to the group of stmts at the start of the page class which...
4
3939
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 the element outside of the table and then using cut & paste in HTML View to move it to the desired location, or by manually typing the code in using HTML View. The first technique sometimes does not automatically update the list of elements...
11
2355
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 class MyString which is a class which is similar to a string public class MyString {
8
6281
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
8155
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 in code that I write in the *.aspx.vb and *.ascx.vb files. Why is it no longer automatically declaring the controls? Is there a way to manually force Visual Studio 2005 to regenerate these files? Is there a setting somewhere that could have...
1
19856
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 that enable a team to collaborate and coordinate a project (software or non software projects). The team collaboration is achieved by several tools and features available as part of "Team Foundation". Team Foundation Server The Team...
2
2195
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 and the code behind, but no graphical design view, which is pretty fundamental for development. I have .net framework 2.0 service pack 1 installed. When I click on view designer it appears to be locked, although there is no message. This happens on...
0
9795
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9642
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10780
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10212
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7753
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5623
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5789
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4421
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3077
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.