Skip to content

Instantly share code, notes, and snippets.

@netsi1964
Created May 5, 2015 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save netsi1964/a3cccab7c11aba668e8d to your computer and use it in GitHub Desktop.
Save netsi1964/a3cccab7c11aba668e8d to your computer and use it in GitHub Desktop.
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