ASP.Net Archive

Visual Studio project not showing in Manage NuGet Packages for solution select project window

I wanted to include an old SiteMap project of mine in a new Visual Studio solution for a project I am working on, but ran into a bit of trouble wanting to add NuGet packages to it. I was able to install packages on the solution’s projects, and on the SiteMap project separately, but not by clicking on the solution itself selecting the manage NuGet …

How to get URL to FuBuMVC input model endpoint in a view

I wrote a small extension method for retrieving the URL to an input model endpoint in FuBuMVC together with my collegue Christer Bermar today. What we wanted to achieve was to have the relative address without the leading slash added to a custom attribute placed on a span tag. Note: If you don’t enjoy reinventing wheels, please have a look at Josh’s comment below and …

EPiServer CustomProperty: jQuery image slide show with HTML captions and smooth transitions using Dev7studios Nivo Slider

While searching for a pretty looking image slide show plugin that would not need me to have a Flash player installed on the client computer, or on the client iPad for that matter, I stumbled across an interesting piece of jQuery; the Nivo Slider from Dev7studios. While there are plenty of WordPress plugins using the Nivo Slider (none of the ones I tried actually working …

How to make EPiServer surveil your config files notifying you on change

I have been a little bit dry on coding inspiration lately, until the other day when my collegue Karl Ahlin gave me an interesting idea concerning monitoring of configuration files. While I enjoyed coding it, I will leave it unsaid if and where it could actually create value. There may still be a few what ifs with the approach, and some of it may be …

Revisited and improved: PageType based filtering of EPiServer’s EditMode PageTree

Some time ago I developed a small plug-in to EPiServer‘s edit mode page tree, allowing web editors to filter its pages based on all available page types. I decided to spend this weekend in the sun on my balcony with my laptop extending the functionality a great deal. The code is as usual available over at GitHub, and also as a NuGet package in the …

Being friends with the PropertyControlClassFactory, or: 101 ways to change EPiServer built-in property appearances

As I have been playing around with using ControlAdapters to change the rendering of built-in EPiServer properties lately, I got curious on what else I could possible do to modify them. As it turns out, the EPiServer PropertyControlClassFactory is a great ally in doing this. Hence, this post mostly revolves around different ways of getting it to do what you want. The example source code …

How to embed EPiServer resources such as GuiPlugIns and Pages together with Images, JavaScripts and Stylesheets in droppable assembly binaries

Recently I got slapped back into reality receiving a Twitter message from my collegue Patrik Akselsson in which he kindly asked me to hand him a GitHub link to the code from one of my blog posts. Being long overdue uploading my code into a public repository and constructing NuGet packages for my EPiServer features, I decided to do so for all my relevant posts. …

Complete and concrete example of what an ASP.NET WebForms Model-View-Presenter project may look like using StructureMap, NUnit and AutoMoq

For quite some time now I have been thinking of creating some sort of sample project to show how a Model-View-Presenter approach may be used in an ASP.NET WebForms project. Lots of what is out there on this subject seem to be rather fluffy in nature, bits and pieces, not really giving you everything that you need; especially if you have not worked with a …

Internet Explorer loses Referrer when redirecting or linking with JavaScript

I came across another Internet Explorer feature today as I was debugging a piece of code related to adding referrer URLs when submitting input forms. It worked perfectly on all versions that I tried of Firefox and Chrome, the referring URL was there, but when it came to IE it just would not give me the address. As the failing incoming link was being syndicated …

Supplying EPiServer scheduled jobs with parameters through Admin Mode

I have always missed a way of supplying arbitrary input parameters to EPiServer scheduled jobs through the Admin Mode scheduled job interface. As Stefan Forsberg laughingly pointed out to me when I told him about my POC for this functionality (something in the lines of “Oh, I see you have found yourself a hammer.”), I seem to have found a way of using control adapters …

Allowing web editors to apply PageType based filtering on the EPiServer edit mode PageTree

When you have an EPiServer installation containing thousands of different pages built up by far-too-many page types, locating pages of just one of them may turn out to be just a little too time consuming. Since I have grown to like the adaptive control approach more and more lately, I decided to create a filtering mechanism for cleaning out dead ends in the EPiServer page …

Recursively finding an ASP.NET control with a specific ID

I wrote a short recursive method for locating specific controls while having no idea of where they are in a nested structure; actually, I added one dynamically and needed to find it again. This will return the first control matching the ID below the supplied root control, if it can find one of course. FindControlRecursively method Usage As Page is also a Control it may …

Surviving IE, or: How to render different markup depending on devices and browsers

The short answer would be, “Create a control adapter, add it to your .browser file and have it applied using browser recognition”. If you want the longer verion, you will have to continue reading. First, let us start with some basics on control adapters. I find them extremely useful tweeking built-in EPiServer (the CMS that I most often find myself working with) controls; especially adding …

Keeping your hair from turning gray, or: How to style the asp:FileUpload control using control adapters

The other day, I got a question from a former collegue of mine who was having trouble styling the ASP.NET FileUpload control, as it renders into a particulary nasty bit of HTML; i.e. an <input type=”file” /> tag. He told me that he would love for it to be just another textbox along with a stupid button. If you have ever tried applying any type …

The ‘Microsoft.ACE.OLEDB.12.0’ provider is not registered on the local machine exception

I got this exception when setting up an old website on a new 64-bit Windows Server. The system was using an old Access database for keeping statistics information, which did not seem to like the new environment. As I did not have Microsoft Office installed on the server I had to download the 2007 Office System Driver: Data Connectivity Components from the Microsoft website. After …

Simple handling of legacy URLs to an EPiServer 4 site migrated to a later version

When a customer wants to move their site from version 4 of the EPiServer platform to a later one, the URLs will change. It is very likely that so will the ids for the migrated pages. Here is a simple method for retaining functioning bookmarks, unbroken links from other websites, keeping RSS readers happy, while at the same time feeding search engines 301 – Permanently …

Removing empty fields from EPiServer XForm e-mails

A customer asked me to see what I could do for their XForm order notification e-mails today. Apparently the department handling their incoming orders was receiving really long e-mails with loads of superfluous information; this as every field in the XForm was being submitted to them, and not just the ones containing data. This is the default behaviour of the XForm functionality, which of course …