Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code syntax error in aspx page with server-side code embedded 3 hours

Status
Not open for further replies.

expresso1000

Programmer
May 1, 2008
1
US
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 })%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top