Does anyone know how can I disable to see cshtml files, e.g /Views/anything.cshtml
? I got 404, The resource cannot be found error message.
I use Umbraco 7.
Asked
Active
Viewed 170 times
-2

Philippe Signoret
- 13,299
- 1
- 40
- 58

levipadre
- 569
- 7
- 31
-
Thats not possible. You need to create a controller and then render your razor view. Or create an .aspx page. – Morten OC May 10 '15 at 12:24
-
Are you asking how to render a custom 404 page? – LoveFortyDown May 11 '15 at 13:08
-
I already have custom 404 page, but that doesn't work with these cshtml. But yes, basically that is what I need. – levipadre May 11 '15 at 13:43
1 Answers
0
Not sure what you need. But you can omit specific URLs by defining it in the web.config:
<add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd,~/log.aspx,/Views/anything.cshtml" />

Kristian Schneider
- 177
- 1
- 7
-
Sorry, probably it wasn't clear. What I meant, the site is working, but when I type something like this `/Views/Master.cshtml` or `/Views/blabla.cshtml`, I got an error message: `Server Error in '/' Application.The resource cannot be found. Description: HTTP 404....` I would like to hide it. – levipadre May 10 '15 at 00:03