Blog entries tagged with Code Samples

PageTreeLoader / PageTreeReader is gone

by: Johan Olofsson

If you (like me) have been using the nifty functions PageTreeLoader / PageTreeReader to load complete hierarchies of pages in EPiServer 4. x, you'll notice that these functions are now gone in EPiServer CMS5 and that EPiServer. Legacy4 suggests that... [ Read full article ]

29 November 2007  1 Comments


"Impersonating users"

by: Johan Olofsson

I sometimes need to run code, especially EPiServer page retrieving/submitting, within a specific user's context, preferrably without having to log them in (and thus having to know and store their password) One approach to this might look something... [ Read full article ]

29 November 2007  1 Comments


Parsing Active Directory Connection Strings

by: Johan Olofsson

Today I had the need to parse an Active Directory connection string (LDAP://server/CN=Users, DC=EPiServer, DC=Com) into its various parts and found the little nifty interface IAdsPathName which does exactly this. By using COM-interop this can be... [ Read full article ]

04 December 2007  0 Comments

Tags:


Enum.Parse() is quite useful

by: Johan Olofsson

I sometimes write code that needs to parse user given arguments, for example through settings in configuration files, parameters given on the command line et. c. The usual way I've dealt with them is to simply perform a bunch of string compares in a... [ Read full article ]

18 December 2007  1 Comments


Hack: Getting the html from a PageData in EPiServer CMS5

by: Johan Olofsson

I've gotten some requests for sample code showing how to get the resulting html for a EPiServer PageData so I thought I would share some ideas I had around this. The question is: "I have got a PageData instance. Now how can I (server side) get the... [ Read full article ]

18 June 2008  9 Comments


Hack: Getting the html from a PageData in EPiServer CMS5 Part2

by: Johan Olofsson

Ok, as you found out if you tried to use the html that was generated using the code in the previous post, you'd notice that all links were rendered in the good ol "classic" style: "templates/page. aspx? id=3&language=en" So, how can we fix that... [ Read full article ]

18 June 2008  0 Comments


Hack: Faking HttpContext under EPiServer CMS5

by: Johan Olofsson

In my previous posts, I showed how one can "fake" a web request by creating a HttpContext and then assign it to the writeable property HttpContext. Current. Now, there is a problem using this approach under the original release of EPiServer CMS5,... [ Read full article ]

23 June 2008  2 Comments


Friendly URL with no rebasing

by: Johan Olofsson

I got a question regarding EPiServer CMS friendly url rewriting about wether it is possible to make the rewritten url's relative to the site's root rather than the context of the requested page. If you look at the html source for a page rendered by... [ Read full article ]

01 July 2008  1 Comments

EPiTrace logger