Last active
October 13, 2015 17:38
-
-
Save benedfit/4232471 to your computer and use it in GitHub Desktop.
Dynamically loading Partial View based on media query in Umbraco and access page properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="/scripts/ajaxInclude.min.js"></script> | |
<footer id="footer" data-append="@Url.Action("Footer", "Modules", new { id = CurrentPage.Id })" data-media="(min-width:45em)"></footer> | |
<script>$("[data-append]").ajaxInclude()</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web.Mvc; | |
using Umbraco.Web.Mvc; | |
namespace MRM.Marketing.Web.Controllers | |
{ | |
public class ModulesController : SurfaceController | |
{ | |
public ActionResult Footer(int id) | |
{ | |
return PartialView("Footer", Umbraco.TypedContent(id)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment