2

I have successfully integrated BlogEngine v3 with an existing MVC 4 application under '/blog' sub-directory and setting it as an application in IIS 7. Both are running fine. The problem now is that I want to customize the BlogEngine UI and I want to use the views from my MVC application, like the header of the BlogEngine should be same as that of the MVC application, so what I want is a way to use the 'Header.chtml' in the 'site.master' of the BlogEngine, directly or indirectly.

PS- I have tried many resources like

  1. http://www.hanselman.com/blog/MixingRazorViewsAndWebFormsMasterPagesWithASPNETMVC3.aspx
  2. https://www.packtpub.com/books/content/mixing-aspnet-webforms-and-aspnet-mvc
  3. How to include a partial view inside a webform

etc... but nothing worked!!

Community
  • 1
  • 1
Krishna
  • 5,194
  • 2
  • 28
  • 33

1 Answers1

0

I have been working on something similar using my MVC website and the integration of BlogEngine. For the theme of BlogEngine (BE), I created a copy of the standard theme, and replaced the CSS file for the new custom theme with my main website's CSS file. I had to rename it to bootstrap.min.css, and it resides in your sub folder, for example if you have installed it in /blog then your themes will be in /blog/Custom/Themes/NewTheme/css, and this is where you want to place the CSS file.

Secondly, you will want to edit the site.master file in the new theme. I opened the shared view from my MVC website, and copied the contents of the header and footer to the site.master file, and this has made the BE pages render almost exactly like my main MVC website. I did notice, however, there are slight variations in sizing (my nav bar is not the exact same in my BE page compared to the rest of the website).

There is a guide on the BlogEngine documentation on how to create custom themes - in your case (mine too) you want to use the same CSS file, and keep the shared views.

BlogEngine Custom Themes

The only thing left for me to accomplish is implementing Single Sign-On with my main MVC website and BlogEngine. That is the tough one!

Hope that helps.

Iqbal
  • 11
  • 2