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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
// Set the page cache duration for the template to be 5 minutes | |
CurrentContext.Page.Cache.PageCacheDuration(300) | |
// Set the page cache duration for the template to be 2 minutes | |
CurrentContext.Page.Cache.StandardListCacheDuration(120) |
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
' This example will hardcode a cache on every oage that uses a particular template | |
Response.Cache.SetCacheability(Web.HttpCacheability.Public) | |
Response.Cache.SetExpires(Now.AddSeconds(60)) | |
Response.Cache.SetValidUntilExpires(True) | |
'We want all Querystring parameters to be cached individually. | |
Response.Cache.VaryByParams("*") = True | |
Response.Cache.SetVaryByCustom("browser") |
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
' If the same URL is registered twice it will only output one reference. | |
' The URL is used as a key to prevent duplicates. | |
' Add a CSS file to the document head | |
CurrentContext.Page.CSS.Add("styles.css") | |
' Note on IEConditions: you can specify any version of IE, the examples below are used for illstration purposes and are not exhaustive | |
' Add a CSS file with an IECondition (target IE7) | |
CurrentContext.Page.CSS.Add("styles.css", IECondition.IsVersion(7)) |
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
' Add a piece of metadata with name and content attributes | |
CurrentContext.Page.Metadata.Add("description", "My page description") | |
' Specify the character encoding for the document. | |
CurrentContext.Page.Metadata.Add(HttpEquiv.ContentType, "utf-8") | |
' Specify the preferred style sheet to use. | |
CurrentContext.Page.Metadata.Add(HttpEquiv.DefaultStyle, "style.css") | |
' Defines a time interval for the document to refresh itself. |
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
// Set the page cache duration for the template to be 5 minutes | |
CurrentContext.Page.Cache.PageCacheDuration(300) | |
// Set the page cache duration for the template to be 2 minutes | |
CurrentContext.Page.Cache.StandardListCacheDuration(120) |
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 Contensis.Framework.Web | |
@using Contensis.Framework.Web.Search | |
<p>Simple Search</p> | |
@{ | |
// Standard properties are prefixed with 'Property_' | |
var query = Query.Where("Property_Title").Contains("news"); | |
// The NodeFinder.Find() method will by default search from the root of the site. |
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 Contensis.Framework.Web | |
@using Contensis.Framework.Web.Search | |
<h1>Search Example</h1> | |
@{ | |
// Queries can be easily chained. | |
var query = Query.Where("MD_ShowOnFrontPage").IsEqualTo("1").And("Property_DateCreated").IsGreaterThan("'12 Oct 2011'"); | |
var nodes = new NodeFinder().Find(query); | |
} |
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 Contensis.Framework.Web | |
@using Contensis.Framework.Web.Search | |
<h1>Simple Search</h1> | |
@{ | |
var query = Query.Where("Property_Path").StartsWith("/Products/Books/").OrSubQuery( | |
SubQuery.Where("Property_Path").StartsWith("/Products/DVDs/").And("MD_ShowInListing").IsEqualTo("1") | |
); | |
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 Contensis.Framework.Web | |
@using Contensis.Framework.Web.Search | |
<h1>Search Example</h1> | |
@{ | |
var query = Query.Where("Property_Path").StartsWith("/Products/Books/").Or("Property_Path").StartsWith("/Products/Toys/"); | |
var nodes = new NodeFinder().Find(query); | |
} | |
OlderNewer