Note that there are some explanatory texts on larger screens.

plurals
  1. POLogOnPartial renders with a blank href - MVC 3
    text
    copied!<p>I'm using a standard MVC 3 Web Project and I've written my HTML out in a standard HTML file, and then copy/pasted it into the _layout.cshtml file. With all the correct RenderBody() and @Html.Partial("_LogOnPartial") included the page works fine, but the ActionLink inside the _LogOnPartial doesn't render an href.</p> <pre><code>Html.ActionLink("Log On", "LogOn", "Account") </code></pre> <p>Will come out as:</p> <pre><code>&lt;a href=""&gt;Log On&lt;/a&gt; </code></pre> <p>This is unchanged from the standard link that you get when you start an MVC 3 Web project.</p> <p>The registered Routes are:</p> <pre><code> public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); routes.MapRoute( "Products", "{controller}/{action}/{id}", new {controller = "Products", action = "Index"}); routes.MapRoute( "Newsletter", "{controller}/{action}/{emailAddress}", new { controller = "Newsletter", action = "Index" }); routes.MapRoute( "Account", "{controller}/{action}/{id}", new { controller = "Account", action = "LogOn", id = UrlParameter.Optional }); } </code></pre> <p>I don't understand why this is happening, but in Visual Studio it is not underlining the Action or Controller which makes me think it isn't seeing the AccountController properly. Anyone got any ideas?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload