Hello,
I have menu on my website, some links are internal and builds with Html.ActionLink method, and some are external and builds with tag.
But I don't like this code, I prefere to have one line instead of two lines. But I don't know how to do it, can anybody help me please?
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<%
foreach (AtomicCms.Core.DomainObjectsImp.MenuItem item in Model.MenuItems)
{
if (!item.IsExternalUrl)
{
%>
<tr align="left">
<td>
<%=Html.ActionLink(Html.Encode(item.Title), "Content", "Home", new { id = item.Entry.Id, name = item.Entry.Alias }, new {title = Html.Encode(item.Title), @class="mainlevel"})%>
</td>
</tr>
<%}
else
{
%>
<tr align="left">
<td>
<a href="<%=item.NavigateUrl %>" class="mainlevel">
<%=Html.Encode(item.Title)%></a>
</td>
</tr>
<%} %>
<%
} %>