I love HttpPostedFileBase! Why? Because it gives me the contenttype from files! But what about the files that I have on my disc and I need to get the ContentType? Unfortunely, you’ll either have to have a huge list with all extensions and their contenttypes which is a major pain. There’re some open source [...]
I had to run an update on some posts before I would do an insert. Then when I was about to do my insert, I got the error that the object was already in use.
SaveOrUpdate gave me that error, and ofc Update too. Merge worked BUT it only saved the parent object and [...]
So I kinda screwed up and changed my database password and totally forgot about my page. This caused the page to be down for a few days without me noticing it until a kind soul told me it was down. (Yes… I’m a bad blogger and I only blog when I feel like it). [...]
XForm is a somewhat of a lazy way out. You know you should do the forms yourself but XForm is simple for the editors and also saves you a lot of job. Anyway, if you want to use XForm to make a poll, you’ll need to make a few adjustments.
First: Create your new [...]
Huge title but pretty much what this post is about.
To optimize your FindPagesWithCriteria, it’s good to be as specific as you can. i.e not use one criteria, get 500 hits back and then just use the top 5 out of those. Anyway, when using a PropertyDataType.Boolean and you want to get back [...]
When you want to alter a page programmatically you need to use EPiServers CreateWriteableClone on the working page. This is because the Page itself is readonly. Now, there’s plenty of info out there how to do this, but just to refresh your mind, here’s some code:
PageData clone = pd.CreateWritableClone(); clone.Property["MyProperty"] = "New value"; [...]
FindPagesWithCriteria is a very handy way to pick up pages that are spread out around your site but there’s a tiny thing that is good to remember when using FindPagesWithCriteria to find pages based on a CustomProperites that you’ve made. Never ever forget to click ”searchable property” when you add the customproperty to your [...]
One of the pages I’ve been working on uses EPiServers categories a lot. But the annoying part with EPiServers categories is the way they inherit down to all children, which leads to the problem that categories can be deleted without someone meaning too. e.g you create a page called ”Books” and you have a [...]
HTML 5 introduces new elements to use such as <header> <section> <nav> and many more. The problem is that no version of Internet Explorer recognizes the new elements, but Firefox, chrome and many others does. The solution is easy but a bit boring when you think about it, since it’s about replacing all new [...]
After upgrading EPiServer CMS5 r2 to CMS5 r2sp2 you might get a nice little error in edit mode. This page is not available for the active language. This is due globalization changes and the workaround is to activate a language for your site. To do this do the following:
1. Go to admin mode [...]