Rizo's

Developing

Sidan är inte tillgänglig för aktuellt språk / This page is not available for the active language – EPiServer5 Upgrade to SP2

by on sep.11, 2009, under Developing

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
2. Click on Config
3. Go to systemsettings
4. Activate Globalization
5. Go to Edit mode
6. click on Language Settings
7. Chose the default language
8. Go back to admin mode
9. Turn off globalization

This should do the trick. Remeber, if you have several sites, you need to click on the root of each one of them and set the language settings on all of them.

22 Comments :, , more...

Visual Studio 2008 System Runtime InteropServices COMException

by on sep.07, 2009, under Developing

I had to make a clean Vista install on my machine and all of a sudden I was getting System.Runtime.InteropServices.COMException when opening old solutions. The error says very little to the user but what it really want’s to say is:

Install IIS 6 WMI Compatibility by going to Control Panel, Programs, Turn windows features on and off and select as the picture below showswindowsfeatures

25 Comments : more...

EPiServer CMS5 Softlinks. How to find a documents linking pages

by on jun.25, 2009, under Developing

Using EPiServers softlink can really come in handy in different situations.  Mostly of course when you need to gather information from the linked pages of a document.

Here’s an example on how to use this:

Example in VB.Net

[sourcecode language=’vb.net’]

Dim f As EPiServer.Web.Hosting.UnifiedFile = TryCast(System.Web.Hosting.HostingEnvironment.VirtualPathProvider.GetFile(filename), EPiServer.Web.Hosting.UnifiedFile)

Dim filecollection As EPiServer.DataAbstraction.SoftLinkCollection = EPiServer.DataAbstraction.SoftLink.Load(f)

For Each file As EPiServer.DataAbstraction.SoftLink In filecollection
Dim ref As New PageReference
ref = file.OwnerPageLink
’now you can work your magic
Next

[/sourcecode]

Example in C#:

[sourcecode language=’c#’]

EPiServer.Web.Hosting.UnifiedFile f = System.Web.Hosting.HostingEnvironment.VirtualPathProvider.GetFile(filename) as EPiServer.Web.Hosting.UnifiedFile;

EPiServer.DataAbstraction.SoftLinkCollection filecollection = EPiServer.DataAbstraction.SoftLink.Load(f);

foreach (EPiServer.DataAbstraction.SoftLink file in filecollection) {
PageReference ref = new PageReference();
ref = file.OwnerPageLink;
//now you can work your magic
}

[/sourcecode]

So what you need to do is pretty much to load up the file reference into a softlink and fill a softlinkcollection with that. Then just run a for each on the collection (since a document can have several linking pages). Once you get your reference, you can just do a getpage on the ref and grab whatever you need from the linking page.

9 Comments :, , more...

* % & : Special Characters in URL and files causing HTTP 400 Bad Request

by on maj.27, 2009, under Developing

One of our customers have a lot of PDF that are linked to their site. Some of these PDF files have % in the filename and this causes a HTTP 400 Bad Request and yes they are encoded correctly. The same error happened with other characters such &, * and :

Finally, the solution was found @ dirk.net with an article regarding 400 bad request in IIS7 (But IIS6 also has the same problem and the solution will work there too). You can read about it here.

22 Comments :, , more...

SQL converting datetime to shortdate

by on apr.20, 2009, under Developing

I’ve a table where I need to select the posts with the latest date. Problem is that when you get the latest date it also gets it by the hour, meaning that it will try to fetch everything older or equal to the date + time, which is nothing. There for, I need to make it a shortdate so I can fetch everything that was posted on that day.

The following code will set the variabel to the latest date on the table.
[sourcecode language=’sql’]
DECLARE @latestDate as datetime
SET @latestDate = (SELECT postDate from table where postDate = (Select max(postDate) from table))
[/sourcecode]
This will return Jan 20 2009 6:45PM

Then all I need to add to my SELECT is
[sourcecode language=’sql’]
CONVERT(VARCHAR(10), @latestDate, 101)
[/sourcecode]
This will return 01/20/2009

22 Comments : more...

Unexpected Provider error! This may be caused by invalid combination of Role and Membership providers. EPiServer

by on mar.20, 2009, under Developing

This error happens after a migration to EPiServer CMS 5 r2 when you try to change the password of a user or possibly create a user. The error is very missleading and has nothing to do at all with the role nor membershipprovider. The error is actually a very simple one.

Another user is using the email that you are providing or your user does not have an email at the moment.

All you need to do is either delete one of the users or change the mail adress of one of the users in order to ”lock them up” and be able to change the password.

20 Comments :, , , more...

Flashdeveloping in AS3

by on mar.12, 2009, under Developing

An ex colleague of mine has started up a blog regarding flashdeveloping in AS3. Robert is a very talented flash developer with a huge portfolio on his back. If you fancy Flash developing, then head over to his blog and bookmark it. The link can also be found on the right column of the page

29 Comments :, more...

Comparison of Strict and Transitional XHTML

by on mar.11, 2009, under Developing

During a makeover of a site I ran into a great site which puts up what that  has been removed from strict xhtml and also a very good overview of all elements and attributes for different doctypes. You can search or browse all elements and see which attributes that are allowed which is of great help when you’re cleaning up a site that uses old attributes. Great example is ”accesskey” which is still allowed in href, labels and a few more, but not in header elements and so forth. Go over there and make sure to bookmark it!

*edit* Thanks Jonatan, what a misstake I made 🙂 the links are now correct

29 Comments :, , , , more...

EPiServer CMS 5 Wrong culture language

by on mar.02, 2009, under Developing

So during an upgrade to EPiServer 5, I ran into this problem where the culture was wrong and all translations were being translated to English instead of Swedish, this even though the web.config was correctly changed to ”sv-SE”.

After som trial and error I got to set the culture in onpreinit in the a class that inherits templatepage like this

EPiServer.Globalization.UserInterfaceLanguage.Instance.SetCulture(”sv-SE”)
EPiServer.Globalization.SystemLanguage.Instance.SetCulture(”sv-SE”)

The problem was that only the dates were being formatted correctly, but the translation was still wrong. CurrentPage.LanguageID was not of much help either as it was set to english. At last I found out that you just need to send the short version of the culture to make it work. i.e

EPiServer.Globalization.UserInterfaceLanguage.Instance.SetCulture(”SV”)
EPiServer.Globalization.SystemLanguage.Instance.SetCulture(”SV”)

This did the trick and now everything is in the right format.

30 Comments :, , more...

Workaround for = EPiServer:Property renders an extra Div

by on feb.27, 2009, under Developing

It’s comfortable to just use properties directly in the page. i.e
[sourcecode language=’html’]

[/sourcecode]
Problem with this, is that it will render an extra div which feels really unnecessary. I’ve tried to look around for a setting of some sort to turn this off but not wanting to waste too much of my time, I just did a simple workaround. Well I didn’t do a workaround, I just render my text in another way.

Front:
[sourcecode language=’html’]

[/sourcecode]
Back:
[sourcecode language=’vb’]
txtMainBody.Text = CurrentPage.Property(”MainBody”);
[/sourcecode]
This will render out exactly whats in MainBody and nothing extra.
Remember to check for nulls 😉

26 Comments :, more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!