SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a feature which specifies a custom user control to be added to the AdditionalPageHead delegate control as such:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="">
    <Control Id="AdditionalPageHead"
        ControlSrc="~/_CONTROLTEMPLATES/15/CustomUserControl.ascx" /> 

The custom user control itself just adds a script block to the page.

When this feature is activated, MDS is disabled on the site collection.

I have set [assembly: MdsCompliant(true)] in the AssemblyInfo.cs and also added the attribute to the control.

public partial class CustomUserControl : UserControl
    protected void Page_Load(object sender, EventArgs e)

It looks like I may need to set SPContext.Current.Web.EnableMinimalDownload but I'm not sure where that needs to be done.

What else do I need to do to make sure activating this feature won't disable MDS?

share|improve this question
Are you overriding the render method? This is the only time I have seen this pattern disable MDS on the page load. – Hugh Wood Apr 17 '13 at 16:56
Did you ever get this working? Thanks! – Steve Lineberry Jun 11 '13 at 16:52

I've written a blog post on a few gotcha's when working with MDS

My guess is that your user control will need a code behind on it and use the SPPageContentManager to register your script in addition to the mdscompliant(true) attribute.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.