Search code examples
internet-explorergraphicsvector-graphicsvml

Why doesn't Internet Explorer render VML on my web page?


First of all, I know that Microsoft stopped developing VML in 1998. In spite of that, I've inherited a web page with a bunch of VML markup and I'd really like to get it working without rewriting the whole thing.

The problem is, I'm moving the page from one technology (classic ASP) to another technology (ASP.net MVC 4) and now the VML isn't rendering anymore. It renders fine in the original page, but when I copy the VML markup to another page, it doesn't render. In order to pin down the problem, I've copied just a tiny fragment of the VML code into a small HTML file, and even that won't render.

The following is rendered as a blank page.

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>    
    <v:polyline modify='false' id='t1' points = "7pt,131pt,6pt,128pt,6pt,128pt,6pt,123pt,6pt,123pt,11pt,120pt,11pt,120pt,18pt,121pt,21pt,123pt,26pt,126pt,26pt,137pt,20pt,143pt,14pt,2in,14pt,2in,8pt,140pt,8pt,140pt,7pt,138pt,7pt,138pt,7pt,136pt,7pt,131pt" >
    </v:polyline>    
</body>
</html>

The desired behavior is that this should render a small shape.


Solution

  • You're not declaring the namespace for the v prefix.

    Also, take a look at this old MSDN documentation about VML.