Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Dynamicweb JSON master and Layout
<!--@MasterPageFile(MasterJSON.cshtml)-->
<!--@Layout.Title(JSON)-->
<!--@Layout.Description(This is useful for returning JSON)-->
<div class="dwcontent" title="main" id="main"></div>
@using Dynamicweb
@using System.Web
@{
var request = HttpContext.Current.Request;
var response = HttpContext.Current.Response;
response.AddHeader("Access-Control-Allow-Origin","*");
}
{"PageID":@GetValue("Global:Page.ID")
,"PageTitle":"@GetValue("Title")"
,"DateShort":"@GetValue("DWDateShort")"
,"AreaID":@GetValue("DwAreaID")
,"content":{"main":@GetString("DwContent(main)")}}
@if(1>2) {
<!--@ContentPlaceholder-->
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment