Archive of C#
-
Programmatically adding files to EPiServer’s File System
Posted on November 23, 2010 by Frederik Vig in C#, Code Snippet, EPiServerHere's a quick code snippet that I used for replacing files on an EPiServer site. A little background, I got asked by a customer to upload a new version of a bunch of images they had in the PageFiles directory...
Continue reading this entry → -
Removing duplicates from a PageDataCollection
Posted on November 27, 2009 by Frederik Vig in C#, EPiServerToday I had to remove duplicate pages from a PageDataCollection. I checked for a method that would help me with this in the SDK, but couldn't find one. I then went to the Filters namespace to see if...
Continue reading this entry → -
SlideShare .NET API Wrapper
Posted on October 18, 2009 by Frederik Vig in .NET, C#In a recent project I had to work with the SlideShare API. Thankfully there was some good documentation to get me started, and even a .NET wrapper for the first version of the API. From SlideShare SlideShare...
Continue reading this entry → -
Adding CSS and JavaScript files dynamically to your ASP.NET page
Posted on August 15, 2009 by Frederik Vig in ASP.NET, C#When starting a new project I always create a Master Page that holds the content that is most used across the site. In my Master Page I have a PlaceHolder for my JavaScript files at the bottom of...
Continue reading this entry → -
EPiServer Link Collection Property
Posted on May 18, 2009 by Frederik Vig in ASP.NET, C#, Code Snippet, EPiServerThe EPiServer Link Collection Property allows you to add links to web pages, documents and e-mail addresses. For a nice overview see this post: EPiServer 5 R2 and Link Collection property In this example I'm going to show you...
Continue reading this entry → -
Safely Cast from bool? to bool
Posted on May 4, 2009 by Frederik Vig in C#, Code SnippetThis is a little code snippet for when you need to cast a nullable type to its value type. if (startPage.ShowMainFeatured.HasValue) { // Safe to cast if ((bool) startPage.ShowMainFeatured) {...
Continue reading this entry →