I have an Html.ActionLink inside an IF statement in a partial view that is not rendering a hyperlink for me as expected. I placed a breakpoint on the line and confirmed that the IF statement is in fact being satisfied and the code inside of it is running. I also, just as an extra measure, tried substituting the Substring with a hard string. Any ideas why no link is rendering for me with this code?
<p>
Resume (Word or PDF only): @if (Model.savedresume.Length > 0) { Html.ActionLink(Model.savedresume.Substring(19), "GetFile", "Home", new { filetype = "R" }, null); }
</p>
Put an
@
beforeHtml.ActionLink(...)
Razor uses
@
for a lot of different purposes, and most of the time it's fairly intuitive, but in cases like this it's easy to miss the problem.