Skip to content

Instantly share code, notes, and snippets.

@benedfit
Last active October 13, 2015 17:38
Show Gist options
  • Save benedfit/4232471 to your computer and use it in GitHub Desktop.
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
<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>
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