Skip to content

Instantly share code, notes, and snippets.

@bjorn-ali-goransson
Created September 15, 2015 20:34
Show Gist options
  • Save bjorn-ali-goransson/07aba0cad0af7be2fb5a to your computer and use it in GitHub Desktop.
Save bjorn-ali-goransson/07aba0cad0af7be2fb5a to your computer and use it in GitHub Desktop.
Remove EPiServer content programmatically
<%@ Page Language="C#" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<script runat="server">
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
EPiServer.DataFactory.Instance.Delete(new EPiServer.Core.ContentReference(333303), true, EPiServer.Security.AccessLevel.NoAccess);
}
</script>
</div>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment