I have a VS .net project that uses .net mvc 5 with razor views so the majority of the views use the .cshtml @..
syntax
How do I customize the 404.aspx page to use to older <%= %> syntax inline? For example in my 404.aspx page when I try to use <%=Url.Action..
I get an error stating the name Url doesn't exist in the current context
. I've set-up customErrors in the web.config which is working fine, but can't get inline logic in the 404.aspx to work.
How should I set-up the 404.aspx
page?
<%@ Page Language="C#" %>
<% Response.StatusCode = 404; %>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page Not Found</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<!-- Error Page for ASP.NET 404 Not Found Errors -->
<div class="navbar navbar-inverse navbar-static-top" id="top-navbar">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<%=Url.Action("Index", "Default", new { area = "" })%>">
Link
</a>
</div>
</div>
</div>
<div class="container">
<h1>Page Not Found</h1>
<p>Sorry, but the page you were trying to view does not exist.</p>
</div>
</body>
</html>