Archive of Code Snippet
-
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 → -
ASP.NET ListView and GroupTemplate
Posted on August 31, 2010 by Frederik Vig in ASP.NET, Code SnippetThe other day I was building a mega menu for a customer - one of the requirements was to let the editor choose the number of columns of links to display. This turned out be quite easy with ASP.NET's...
Continue reading this entry → -
Adding different CSS classes when using the EPiServer PageTree control
Posted on February 28, 2010 by Frederik Vig in Code Snippet, EPiServerAnother little quick tip. I was browsing the EPiServer World forum and came across a common question. by David Green I am using the EpiServer:PageTree control to generate a nested <ul><li> list in the format below. However I am...
Continue reading this entry → -
Sending confirmation email to the user when using EPiServer XForms
Posted on October 17, 2009 by Frederik Vig in Code Snippet, EPiServerPlenty of websites have contact forms or other forms that users fills out to either make a request or provide feedback. This is something that many sites use instead of making their email address public available. To avoid receiving to...
Continue reading this entry → -
Creating a Custom EPiServer Paging Control
Posted on September 20, 2009 by Frederik Vig in Code Snippet, EPiServerEarlier I wrote about the PageList control from EPiServer, I mentioned in that post that the markup that the PagingControl renders is not the best. For instance it will not work without JavaScript enabled on the client (for...
Continue reading this entry → -
Add class attribute to body element with ASP.NET web forms and Master Pages
Posted on August 27, 2009 by Frederik Vig in ASP.NET, Code SnippetOften I have to add a class to the HTML body element. This is a little code snippet that allows you to easily do this...
Continue reading this entry → -
EPiServer filter – part 2: create your own filter
Posted on June 28, 2009 by Frederik Vig in Code Snippet, EPiServerIf you haven't, be sure to check out EPiServer filter - part 1. In one of my project I had a bunch of categories and needed to filter a PageDataCollection to find pages that had one or more of...
Continue reading this entry → -
CSS tricks – part 1
Posted on May 31, 2009 by Frederik Vig in Code Snippet, CSS, Web designHere are a few CSS tricks I've picked up along the way. Always visible vertical scrollbar When you have a fixed width centered web site open you've probably noticed that the page sometimes jumps a little. This is because the vertical scrollbar...
Continue reading this entry → -
EPiServer filter – part 1
Posted on May 28, 2009 by Frederik Vig in Code Snippet, EPiServerOften we need to filter some of the pages in our PageDataCollection. Perhaps we wish to only show the pages that are published or that the user has access to. For this EPiServer has a few filter classes. Below you'll...
Continue reading this entry → -
Master Pages and EPiServer CurrentPage property
Posted on May 20, 2009 by Frederik Vig in Code Snippet, EPiServerWhen you use user controls or web forms in your EPiServer web application you usually inherit from either UserControlBase or TemplatePage. Which gives you, among other things, the CurrentPage property. The problem is when you need the CurrentPage property in...
Continue reading this entry →