SaaS CMS has officially launched! Learn more now.

Server rendering HTML with Javascript


It gets more and more popular for every day to render HTML with JavaScript libraries such as Knockout, React, Angular, etc. It's also getting more popular and viable to execute that JavaScript on the server as well as on the client using Node.js, with Microsoft exploring the field on how to integrate it with ASP.NET (

Is this something that Episerver is exploring as well? There are great advantages for dynamic and interactive sites to use these frontend tools to keep the code base under control, but there's very little aid from Episerver today with that approach. You basically end up working aganist Episerver, which is very unfortunate.

Dec 05, 2015 12:21

What are you after in the product?

I would just serve Epi content types or view models as JSON and go from there. The JS framework of choice changes every month anyway.

Feb 15, 2016 20:47

That's what were doing and it's working pretty nicely. But we've had to jump through some hoops to get on-page-editing to work. So I guess that's what we're after; not having the on-page-editing so coupled to Razor and not having to use MutationObservers to override when Episerver applies updates.

Feb 15, 2016 20:56

@Anders: I am really wondering how you got on-page-editing to work. Which hoops did you have to go through? It seems like a frightfully complex undertaking.

P.S. Could you update on us whether the state of on-page editing has improved (being more decoupled from epi) in later Epi versions?

Sep 23, 2016 15:11

It certainly wasn't easy, and one Episerver release broke our implementation so we had to almost redo it. But our current implementation is pretty solid. Wish I could share it but I'm pretty sure we're unique with it.

  1. I wouldn't say that on-page-edit has gotten more decoupled, you just have figure out where to hook in.
Sep 24, 2016 8:04

@Anders, Its good to see that someone successfully done it.

Can you share a bit more of your experience with us?

Is it still working? Was it as solid as you've expected?

Jan 27, 2017 12:37

We've had a site running it in production for about four months now, and it's been solid. We've hit some bumps in the road but nothing we haven't been able to fix.

Wish I could tell you more but the solution we've created is rather unique and it's something we want to keep internal at least until others catch on.

Jan 27, 2017 14:26

Maybe you just think it's unique ;) Since you won't share your experience no one will ever know.

Jan 27, 2017 14:32

Maybe so. :) Feel free to ask concrete questions and I'll answer as much as I can.

Jan 27, 2017 15:40

Hi Anders Ekdahl.

I am curious how you rendered the SPA application? I am not a epi developer but work with them.

We are working on implementing the Angular CLI projekt and render it in EPi, we are not interested in the OPE functionality at this point.

After building the Angular CLI project we get three files (.html, .js and .css). How would you implement the Angular project into EPi so it renders on a Epi site?

I have a background in SharePoint and the way we render a javascript application there is basicly a webpart that points to a index.html (from the SPA project), the .html file is then pointing to the javascript files and they are all located in the "Site Assets" folder on the site.

How would it work on a EPi-platform?

Mar 09, 2018 11:15

Hey Anders,

What JS framework did your project go with? I'm currently trying to work out some things with React and Epi and I'm curious if you may have dealt with some of the issues I'm facing now.

Feb 01, 2019 23:35

We're using React as well. What we do is basically that we've turned the site into an API, so that all content is accessible as JSON (but still have the same urls like before, Epi still controls the routing).

When a request comes in we check if it's an ajax request or not, and serve JSON or do server rendering.

Episerver has exposed a few hooks now to make it easier to hook into on page editing, but that unfortunately only works for simple values. The solution we came up with covers content areas and blocks as well, so we've continued with that even though it's quite a hack. We override `innerHTML` on the DOM node and intercept when Episerver tries to update and run our code instrad.

Feb 02, 2019 7:24


It would be great if you could share the details of your work in a blog post.

Feb 04, 2019 16:38
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.