This Razor tag:
@:[ @Html.ActionLink("Log On", "LogOn", "Account") ]
renders like this:
[ Log On (/ACCOUNT/LOGON) ][/code]
This is the generated HTML:
[ <a href="/Account/LogOn">Log On</a> ]
How do I keep it from doing this or does it just do it in debug mode?
If it does, that is kind of stupid because it messes up my view of my template.
Also, how do I do this in Razor:
<a href="http://myexternallink.com"><img alt="external" src="@Url.Content("./Content/themes/base/images/spacer.gif")" class="icoExternal"></a>
This syntax
simply throws an exception as it is invalid syntax.
Assuming default routes:
Renders:
in all modes (Debug, Release, whatever) which is the expected behavior.
That’s the expected behavior, I don’t understand why do you want to keep it from doing this? If you don’t want the square brackets simply remove them:
As far as your second question is concerned: