Had some trouble loading a vitrual file containing spaces.
The problem was apperently that some characters were urlencoded, a simple Server.UrlDecode(CurrentPage["DocumentPath"]) solved the problem.
A blog about understanding and extending EPiServer
You are currently browsing the monthly archive for April 2008.
Had some trouble loading a vitrual file containing spaces.
The problem was apperently that some characters were urlencoded, a simple Server.UrlDecode(CurrentPage["DocumentPath"]) solved the problem.
Tags: urldecode, urlencode, virtual file
I’ve had some problem to link to a page to another language then the current language.
Even though I have a PageData-object with anouther languagebranch, it stills makes a link to the current language.
My own solution, building a url by CurrentPage.StaticLink and adding epslanguage=langID, works but it’s not how I want to do it.
So today I found the EPiServer.UriSupport class. In that class you have EPiServer.UriSupport.AddLanguageSelection(pd.LinkURL, pd.LanguageID), just what I’ve been looking for.
Tags: episerver cms 5, language, link, pagedata, url
VirtualFile file = System.Web.Hosting.HostingEnvironment.VirtualPathProvider.GetFile( CurrentPage["FilePath"].ToString() );
UnifiedFile f = file as UnifiedFile;
return f.Length / 1024 + ” kb”;
Tags: cms, EPiServer CMS 5, filesize, virtual file
The new properties AppSettings and AppSettingsMultiple in EPiServer CMS 5 is a pretty nice feature, but when yesterday when I tried to implement it, I had a hard time finding out how to do it. But finally I did.
First of all, in edit mode, AppSettings will create a DropDown and AppSettingsMultiple will create a CheckBoxList.
To create you AppSettings property you have to define some values in <appSettings> in your Web.Config, i did like this:
<add key=”PropertyCountries” value=”Czech republic;CR|Sweden;SV|United Kingdom;UK” />
Now you just have to add a Property to your pagetype with the name PropertyCountries and you are done.
When you use the AppSettingsMultiple the CurrentPage.Property["PropertyCountries"].Value will return a comma separated string with the selected values, like “SV,UK” and you just have to do a simple .Split(‘,’) and you have a string array.
Latest comments