Mathias Kunto Archive
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 …
Some time ago I wrote a post about retrieving and updating the MaxMind GeoIP database using Windows PowerShell scripts, and suggested the possibility to have the Windows Task Scheduler automating the process. Mostly for my own amusement, I decided to have a go at making the EPiServer scheduler do the work as well; perhaps there would also be scenarios when web administrators would need to …
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 …
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 MaxMind GeoIP database (shipped with EPiServer Framework) is rather useful when wanting to show geographically specific information to visitors as they surf around the site. Since mapping the correct requests to the proper regions may be rather important generating value, the need of having a fresh database copy quickly comes into focus. Manually updating the database is of course not at all complicated; it …
Windows PowerShell scripting is a powerful way of automating otherwise tiresome and error prone manual tasks. I recently looked into how I could have Windows running my scripts for me. It is not difficult, but it still took some poking around to get done. New tasks are added using the Create Task option in the Actions area. The General tab will let you decide how …
I ran in to a problem with my migrated EPiServer 4 website when creating new pages programmatically. The old site was using English as the master language, but my new one would be all in Swedish. I had used the version of the Advanced Language Manipulation Tool that Mari Jørgensen updated to convert my pages, as well as the SQL provided by Dane Richards (comment …
A client was using CurrentPage.Changed.ToShortDateString() for displaying a Last updated date in the inner footer of their pages. They often, however, forgot to select the Mark page as changed-checkbox on the Settings tab, and asked me if it was possible to have it selected by default. Here is a simple way to do it. Global.asax.cs In your Global.asax.cs file, add an event handler to the …
I noticed a problem with a customer’s XForm earlier; no matter how many times I posted data, I was not able to find it through the Edit mode Form Data-tab. It was not until I marked the checkbox Show data for all pages that I got any hits. The XForm data exist in a table called tblXFormData in the EPiServer database. Checking the content of …
An annoying problem that sometimes occur in EPiServer websites happened to my new EPi 6 R2 the other day. I have seen it before but always seem to forget what the reason is, and have to waste valuable time looking to solve it. So, here it is. Hopefully it may save somebody a bit of pain; or me, the next time I stumble upon it. …
I got two exceptions today trying to use an EPiServer SearchDataSource in order to find files in the VPP directories. Not rocket science solving them, but I thought that I would make a short post anyway hoping it might make somebody’s life easier. System.IO.IOException: \\server\VPP\Global\index not a directory The first exception occured as my VPP folders did not yet contain index directories. The EPiServer Indexing …
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 …
Tinkering around with a small EPiServer tool plugin that I am building (will be found in a later post), I decided that I wanted to try out the PageTree control; I have not been using it that much, and wanted to know what it could offer me. Nice, easy to use, and lots of work already done. Sweet. What it did not give me however, …
When working with EPiServer sites, a not all that uncommon type of support case is the need to change text on a page which is not editable through the Edit mode. Quite often, this text is located in language files on the web server, and it may be rather tiresome for web editors having to send change requests to the support or development team just …
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 …
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 …
I was working with dynamically added TextBox controls in an unknown structure of recursively nested Repeaters the other day, and needed to loop through them after they were posted back to the server. Since I had no idea of where they were located, how many they were nor their IDs, I solved it in the simplest way that I could think of; by creating a …
This is a follow up to my previous post about allowing web editors to dynamically change the content of their static error pages (this one). The solution I described would not let us insert any graphical elements requiring database access; such as images from EPiServer’s VPP folders. Here is a way to do it; sample code can be found at the bottom of this post. …
Some time back, I encountered the need to dynamically alter static error pages through EPiServer’s edit mode; or more specifically, edit an error page for a 500 Internal Server Error, caused by a database related failure. Since it might be tiresome for editors to change static files on a webserver, and since EPiServer tends to enjoy having a database connection retrieving pages, I needed to …