I am trying to concatenate the c.name
with Response.Write(counts[c.ID]);
Basically, in the <li>
, I want it to be "Category name (x)".
So, basically shove the if
statement after the c.name
. How can this be done?
<li>
<%:Html.ActionLink(c.Name, "Browse", "Listing", routes, null)%>
<%
if (showCounts && (bool)(ViewData["ValidCategoryCounts"] ?? true))
{
Response.Write("(");
if (counts.ContainsKey(c.ID))
{
Response.Write(counts[c.ID]);
}
else
{
Response.Write("0");
}
Response.Write(")");
}
%>
</li>