This is my html code:
<span>
<%if (Model.Data.Service.Attachments.Count > 0)
{
%><h3>Downloads for your service:</h3> <%
foreach (var attach in Model.Data.Service.Attachments)
{
%><%=attach.Name%>: https://<%= Request.Url.Host%> "/File/Download/" <%= attach.Id.ToString()%><br />
}<%
}%></span>
The error is saying that I am missing a “{” but I dont believe that is what is going on here
The closing brace of your foreach isn’t in a <% %> block. It needs to be:
Or to make it a bit neater try using string.Format instead: