I am scratching my head as to why not this isn't working:
@if (Model.Guid != null) { Html.ActionLink("Fil", "GetFile", new { id = Model.DocumentID }); }
The conditional on its own is working as putting som random HTML in there instead of an actionlink works:
@if (Model.Guid != null){<span>Test</span>}
Likewise the actionlink on it's own renders without a problem.
Could anybody clue me in to what is going on here?
You need to put an @ sign before the Html.ActionLink.
Like this:
@if (Model.Guid != null) { @Html.ActionLink("Fil", "GetFile", new { id = Model.DocumentID }); }
EDIT: Forgot to add that you don't need the semi colon, but you can leave it in if you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With