Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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="http://schemas.microsoft.com/sharepoint/">
    <Control Id="AdditionalPageHead"
        Sequence="90"
        ControlSrc="~/_CONTROLTEMPLATES/15/CustomUserControl.ascx" /> 
</Elements>

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.

[MdsCompliant(true)]
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
1  
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

1 Answer 1

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

http://steve.thelineberrys.com/gotchas-using-custom-web-parts-and-the-minimal-download-strategy/

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

 
discard

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.