SaaS CMS has officially launched! Learn more now.

Unclosed tags



I am trying to add google variance testing on a page but when the page is rendered it removes the </unscript> tag from the page as it does not have an opening tag.


This is what I have coded on the page

<script>utmx_section("Slide images")</script>Content...     </noscript>   

but when the page is rendered on the website it removes the unscript closing tag

<script>utmx_section("Slide images")</script>Content...


I have tried various options in the episerver configuration section in the web.config but no success so far. Has anyone came accross the same problem? Any help would be appreciated


Aug 24, 2010 16:26

When you say you have it coded in the page, do you mean in the page Template? If you are using a property it is true that the Xhtml property does processing on the HTML so it might be removed by that. In that case, try to use a longstring property and uncheck all the options for the longstring property.

Aug 24, 2010 17:09

I have the code on the actual aspx page not in the page template.

    <div class="divSlideshowImage">
<script>utmx_section("Slide images")</script>Content...     </noscript>

I can see the noscript tag in the actual aspx page but when it is rendered on the page the tag is removed.

Aug 24, 2010 17:30

I can't see how this would happen - it should output pretty much anything you put in there which isn't interpreted as server tags. How do you notice in the client that the tag is missing? Is it really missing if you view the page source or view the http response content using for example firebug (not the default "html" view which shows a parsed and processed version)?

Aug 24, 2010 20:06

I have viewed source of the page and the tags are missing on it. I have tried putting other unbalanced tags i.e only closing tags and they are all removed. I am using visual studio 2008 and have tried the same with a non episerver website and the tags are rendered as expected.

Aug 25, 2010 14:03

I tried adding a single </noscript> inside a contentplaceholder of my default.aspx and it renders as expected. CMS 6, IIS 7, Windows 7.

Aug 25, 2010 14:10

Interesting I am using CMS 5 , Windows 7 and Cassini Webserver/IIS 7 and tried the same as you and it doesn't work. I also tried it with Relate+ which is based on CMS6 and ti does not work for me.




asp:Content ID="Content1" ContentPlaceHolderID="MainRegion" runat="server">




<div class="leftCol">

and when it renders I viewd source and it doesn't show it.


   <div id="ctl00_UpdatePanel1">

    <div class="leftCol">
        <div id="ctl00_MainRegion_homeTabList_UpdPnlTabControl">
Aug 25, 2010 14:24

I have tried this on a brand new episerver website. I used CMS 6 , IIS7 and windows 7 and it still removes the unbalanced tag. I am not sure how it is working for you. Is there anyone else who is having the same issue

Aug 25, 2010 17:00

My guess would be that it is removed by the HTML Rewrite filter used by the Friendly URL rewriter. Try to change your URL Rewrite provider to NullUrlRewriteProvider and if that fixes your issue you know where the problem lies.

Out of curiosity, why would you want an unbalanced element to begin with?


Aug 26, 2010 4:02

I think that might have been spot on Henrik! It so happens that the site where I tested didn't use FURLs. Tried it again now in a new CMS 6 site and the unbalanced </noscript> is indeed removed.

Mohammed, I'm sorry for not recognizing this right away.

Aug 26, 2010 6:47

Thanks Henrik and Magnus. It works without friendly Url turned on but I need the friendly Url module turned on because of SEO stuff. Any suggestion how  to get around this problem? The reason I am using unbalanced tag is google multi variant testing which requires the script to be written with an unbalanced tag. e.g

<script>utmx_section("Slide images")</script>Content...     </noscript>

Aug 26, 2010 10:42

You could get the unbalanced tag in the document by using javascript and document.write, but that might upset the test...

Aug 26, 2010 10:46

Yes, my suggestion was of course not to turn off the FriendlyURL rewriter for anything else but to confirm that this was the problem.

For a discussion on how make the Google multi variant test work with valid XHTML can be found at:

Don't know much about it myself though. Good luck!

Aug 27, 2010 0:23

I have this exact problem now. Is there still no solution?

Dec 09, 2011 15:56

Could you use this old module to make it work? 

Dec 09, 2011 16:06

I'm afraid not, even tho I don't know the internals of that module. But it seems it's mainly for including GA? I need to enter invalid html in the middle of an .aspx page (like this: <script>utmx_section("Slide images")</script>Content...     </noscript>), but with Friendly URL turned on the </noscript> bit of the snipplet is removed.

It's weird that Google requires us to write invalid html, but according to the following page there is no alternative:

Dec 09, 2011 16:15

I did not implement a proper solution but I fixed my issue by writing a new module. I did not have a friendly url requirement for the google variation page so I excluded the specific page in my module


Add a module in Web.config 

<urlRewrite defaultProvider="FriendlyUrlRewriteProvider">
<add name="EPiServerFriendlyUrlRewriteProvider" description="EPiServer standard Friendly URL rewriter" type="EPiServer.Web.FriendlyUrlRewriteProvider,EPiServer" />  

 Module code


using System;
using System.Web;
using EPiServer.Web;
using System.IO;
using System.Text;

namespace EPiServer
public class FriendlyUrlModule : EPiServer.Web.FriendlyUrlRewriteProvider

public override HtmlRewriteToExternal GetHtmlRewriter()
if (HttpContext.Current.Request.Url.AbsoluteUri.ToLower().Contains("URLTOREMOVE"))
return new NullHtmlRewriteToExternal();
return new FriendlyHtmlRewriteToExternal(UrlRewriteProvider.RebaseKind);



// Hack to remove html validation for the google web optimizer
internal class NullHtmlRewriteToExternal : HtmlRewriteToExternal
// Methods
public override Stream GetRewriteFilter(UrlBuilder internalUrl, UrlBuilder externalUrl, Encoding encoding, Stream stream, out RewritePipe rewritePipe)
rewritePipe = new NullRewritePipe();
return stream;

public override string RewriteString(UrlBuilder internalUrl, UrlBuilder externalUrl, Encoding encoding, string html)
return html;


It should not be hard to make it work with friendlyUrl but I did not try it.


Dec 09, 2011 16:35
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.