none
Quirks Mode Rendering instead of Standards Mode

    Question

  • I am working on a legacy ASP page and have the following code specified at the top of my asp page:

     

    <%@ Language = VBScript%> 
    <% Option Explicit%>   
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     



    Expression web is rendering the document in quirks mode instead of standard mode which it should due to the doctype declaration.  Can i force EW2 into rendering in standards mode instead of quirks mode?

    Friday, February 06, 2009 3:50 AM

Answers

  • From Microsoft Expression Support:

    I’ve gotten a response back from our developer support team. They confirmed that this is a known bug with Expression Web 1 and 2 which will be addressed in the next version of Expression Web (version 3). I don’t have an ETA for the release of the trial or beta of Web 3, but stay tuned to the Expression Web forum and it will be announced when the open beta and trial are available for version 3 and you can confirm the fix.

    • Marked as answer by Ardentra Monday, February 09, 2009 5:41 PM
    Monday, February 09, 2009 5:41 PM
  • I was going to respond back to the thread but looks like Ben beat me to it. I did get authorization from the developer team to let it be known that this is a bug in EW 1 and 2 and that this will be addressed in Expression Web version 3.

    Will Buffington
    Microsoft Expression Support
    • Marked as answer by Ardentra Monday, February 09, 2009 6:04 PM
    Monday, February 09, 2009 5:50 PM

All replies

  •  Well, it renders in Standards mode if you remove the
       
    <% Option Explicit%>      
       
     
    from in front of the Doctype declaration. 

    ...I guess this qualifies as an EW "quirk".
    Friday, February 06, 2009 5:34 AM
  • So no solution then?  How can i report this as a bug to Microsoft?  Can i pay for support and get them to fix?  Is there a registry setting i can set that will force the designer into standards mode all of the time?

    Friday, February 06, 2009 5:46 AM
  • Ardentra said:

    So no solution then?  How can i report this as a bug to Microsoft?  Can i pay for support and get them to fix?  Is there a registry setting i can set that will force the designer into standards mode all of the time?

    Bug? Solution? EW makes precisely zero claims to supporting Classic ASP. How, then, do you see this as a bug? Furthermore, no "solution" is required. All that the Option Explicit declaration accomplishes is to require that the programmer declare his variables before using them. The obvious "solution" in this instance is to simply require the programmer discipline that should be expected of anyone deserving the name to declare his variables before using them.

    The "designer," if by that you mean EW2, is already in "standards mode all of the time." It is the browser(s) that take issue when their parsers encounter markup with which they do not know how to deal. EW2 produces standards-compliant markup and CSS. It is not the fault of Expression Web that code is introduced which is beyond its capacity, or the intent of its developers, to avert from causing browsers to enter quirks mode.

    You may report this "bug" via Microsoft Connect, and it will probably be greeted with the stunned disbelief and then raucous laughter that it deserves.

    cheers,
    scott (who, lest there be any mistake, does not work for Microsoft, nor any of its entities, nor receive any honorific or compensation from them by dint of his participation here)

    Friday, February 06, 2009 6:22 AM
  • Scott, I doubt very much that the Option Explicit puts browswers into quirks mode.  (Wouldn't it be stripped off by the asp parser before the page was fed to the browser, anyway?)  It is EW that is saying it is in quirks mode: look at the bottom of the design window.

    On the other hand, I agree with you that (a) EW never claims to support ASP, so the fact that it doesn't recognize this line wouldn't be seen as a bug, and (b) the line is not necessary anyway, so the way to make EW stop saying it's in quirks mode is to simply remove it.
    Friday, February 06, 2009 1:42 PM
  • Scott,

    That has to be the most assinine reply I have ever seen.  I mean seriously you are probably the biggest jerk i have ever encountered online.  I am baffled at how utterly inept and uneducated your reply is.  The option explicit is a standard notation used in asp code everywhere.  Its comical to suggest that by using option explicit somehow is a bad thing (you are the first moron i have ever met to assert that).  The designer (EW2) is not in a "standards mode all the time".  Have you ever even used EW2?  Down in the status bar you have quirks or standards mode and EW2 changes the layout accordingly. 

    See http://blogs.msdn.com/xweb/archive/2008/12/17/the-quirkiness-of-quirks-mode.aspx for an example.

    Option Explicit is not required true but any code blocks before the doctype also jump the designer into quirks mode.

    Example:

    <%@ Language = VBScript%> 
     
    <%  
        dim iPaludunIsAJerk, strScottIsADoosh  
    %> 
     
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     

    So I guess I'll ask again.  Does anyone know of any registry key to force EW2 to render in standards mode all the time?  While the designer does not specifically support ASP, I've found that its a great editor and this is the only "bug" I have found. 

    Thanks in advance.

    Friday, February 06, 2009 3:57 PM
  • You might try removing the empty line between the option explicit and the doctype.

    <%@ Language = VBScript%> 
    <% Option Explicit%>   
    <!DOCTYPE . . .


    You can also by putting option explicit on the some line with no spaces between them.

    There is no registry key option. Design view is not a substitute for previewing in a browser you will need to configure EW to previous using IIS since the included server does not support classic ASP. When rendered in the browser you should see standards mode.


    MS MVP Expression http://by-expression.com
    Friday, February 06, 2009 4:04 PM
  •  Cheryl, those two suggestions don't make any change to EW's respose to the <% Option... line.

    Taking out that line, or ignoring EW's "quirks" mode seem to be the choices.
    Friday, February 06, 2009 4:16 PM
  • Hi Cheryl,

    Yeah no dice on moving option explicit to the same line.  I don't think you understand how IIS works.  IIS 6 & 7 can serve ASP pages just fine.  The server interprets the server side code and performs certain actions then writes out the appropriate page.  When this page is sent through the server the browser only sees the doctype-- not the stuff in between <% and %>.  This is not a server issue but a EW2 client issue.  EW2 should not be rendering design view in quirks mode, or should allow me to force standards mode rendering somehow.

    Do you guys know any options for paid support?  Thanks so much for the help (excepting Scott).

    Thanks,
    Ben
    Friday, February 06, 2009 5:37 PM
  • I'm not sure what you would expect from paid support, except a lighter pocket.  EW was not sold as supporting ASP code, and it is what it is.  I suspect you'd just get the same answers as you found here.  But here it is: 
    https://support.microsoft.com/oas/default.aspx?&gprid=12105&

    "I don't think you understand how IIS works.  IIS 6 & 7 can serve ASP pages just fine."

    As to Cheryl's comments, you misread them.  She said IIS *does* support asp.  The included server that doesn't, which she referred to, is the development server that comes included with EW, which those of us who can't (e.g. Win XP Home) or don't have IIS can use for previewing asp.net and php pages.
    Friday, February 06, 2009 6:27 PM
  • Ardentra, you are entirely justified in your response. My reply was inappropriate, and I apologize. I'm afraid that I did something that I try to avoid, which is to post when my faculties are diminished. Last night was my oldest friend's birthday, and we celebrated it heartily, perhaps a good deal too heartily in my case. I had no business posting in the condition I was in upon my return, and it showed in that message, to my chagrin.

    cheers,
    scott
    Friday, February 06, 2009 8:15 PM
  • Ben,

    I do know how ASP and option explict work but sometimes any space aka the empty line between your asp and the doctype can change something to quirks mode. Design view is only at best an approximation of how a standards complaint browser will render the page and should not be relied upon as the way it will render in any specific browser.

    My suggestion was an attempt to get Expression Web to ignore the content between <% and %> and not see any spaces. Since Classic ASP is not recognize by Expression Web I figured it was a long shot but that was the best one I could offer.

    I would suggest simply ignoring the rendering in design view and preview frequently in IIS (not the testing server, use a custom url in the Site > Site Settings > Preview section) for checking how the page actually renders. Since Expression won't process any of the asp anyway it seems the best option to me.


    MS MVP Expression http://by-expression.com
    Friday, February 06, 2009 10:14 PM
  • From Microsoft Expression Support:

    I’ve gotten a response back from our developer support team. They confirmed that this is a known bug with Expression Web 1 and 2 which will be addressed in the next version of Expression Web (version 3). I don’t have an ETA for the release of the trial or beta of Web 3, but stay tuned to the Expression Web forum and it will be announced when the open beta and trial are available for version 3 and you can confirm the fix.

    • Marked as answer by Ardentra Monday, February 09, 2009 5:41 PM
    Monday, February 09, 2009 5:41 PM
  • I was going to respond back to the thread but looks like Ben beat me to it. I did get authorization from the developer team to let it be known that this is a bug in EW 1 and 2 and that this will be addressed in Expression Web version 3.

    Will Buffington
    Microsoft Expression Support
    • Marked as answer by Ardentra Monday, February 09, 2009 6:04 PM
    Monday, February 09, 2009 5:50 PM
  • Thanks Will!  Appreciate all you guys do.
    Monday, February 09, 2009 6:04 PM