Rusty Divine

Live, Love, Learn, Teach

BlogEngine 2.5 .cshtml Razor Page Not Found

I fixed the 404.3 error I was getting in BlogEngine when navigating to pages that end in the Razor extension ".cshtml" by editing the links to those pages to remove the .cshtml extension.  The menu links I saw affected were admin\Default (dashboard), admin\Settings\Themes, admin\Extentions, admin\Logout, 

First, I did a global find in VS (ctrl+shift+f) to find anything that matched .chstml"  (I included the closing double-quote in my search since I was looking for links to these pages).  Then, I changed any code that was creating a hyperlink to a .cshtml page so that it instead was calling the appropriate action method.  For example, I changed "account/logout.cshtml" to "account/logout", and I changed "~/admin/default.cshtml" to "~admin/default" because even though "default" will be the default action and therefore not necessary, the tab menu tool needs to have the word default there or else it thinks you are always on the dashboard tab.

The files I changed:

  • Web.siteMap
  • admin\Settings\Themes.cshtml
  • admin\_Layout.cshtml
  • admin\Settings\Menu.ascx
  • admin\Settings\_menu.cshtml
blog comments powered by Disqus