expresso1000
Programmer
I'm trying to figure out why in my if statement, the container is not recognized but is in my ActionLinks. Container.DataItem is working just fine in my ActionLinks (MVC).
<FileTemplate><span class="file">
<% if ( %> <%# Container.DataItem.IsVirtual %> <% )
{ %>
<%# Html.ActionLink(Container.DataItem.Name, "Show", "Page", new { ID = Container.DataItem.ID })%>
<%}
else
{ %>
<div style="color: Green;">
<%# Html.ActionLink(Container.DataItem.Name, "New", "Page", new { ID = Container.DataItem.ID })%>
</div>
<%} %>
<%# Html.ActionLink(Container.DataItem.Name, "New", "Page", new { ID = Container.DataItem.ID })%>
</span></FileTemplate>
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1525: Invalid expression term ')'
Source Error:
Line 17: <FileTemplate><span class="file">
Line 18: <% if(%> <%# Container.DataItem.IsVirtual%><%){%>
Line 19: <%# Html.ActionLink(Container.DataItem.Name, "Show", "Page", new { ID = Container.DataItem.ID })%>
<FileTemplate><span class="file">
<% if ( %> <%# Container.DataItem.IsVirtual %> <% )
{ %>
<%# Html.ActionLink(Container.DataItem.Name, "Show", "Page", new { ID = Container.DataItem.ID })%>
<%}
else
{ %>
<div style="color: Green;">
<%# Html.ActionLink(Container.DataItem.Name, "New", "Page", new { ID = Container.DataItem.ID })%>
</div>
<%} %>
<%# Html.ActionLink(Container.DataItem.Name, "New", "Page", new { ID = Container.DataItem.ID })%>
</span></FileTemplate>
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1525: Invalid expression term ')'
Source Error:
Line 17: <FileTemplate><span class="file">
Line 18: <% if(%> <%# Container.DataItem.IsVirtual%><%){%>
Line 19: <%# Html.ActionLink(Container.DataItem.Name, "Show", "Page", new { ID = Container.DataItem.ID })%>