问题
<table cellpadding="0" cellspacing="0" width="100%">
<% if(ViewData["CustomerInfoList"] !=null && ((List<SaaSModel.CustomerInfo>)ViewData["CustomerInfoList"]).Count()>0)
{
%>
<tr>
<td>
<%
Html.Grid((List<SaaSModel.CustomerInfo>)ViewData["CustomerInfoList"]).Columns(
column=>
{
column.For(col=>col.CustomerName).Named("Name");
column.For(col=>col.CompanyName).Named("CompanyName");
column.For(col=>col.Description).Named("Description");
column.For(col=>col.CustomerRevenue).Named("CustomerRevenue");
column.For(col=>col.NoOfEmployees).Named("NoOfEmployees");
column.For(col=>col.Vertical).Named("Vertical");
column.For(col=>col.SaleExecutive).Named("SaleExecutive");
}).Attributes(id=>"datalist",@class=>"silicaGrid",cellspacing=>"1",cellpadding=>"0");
%>
</td>
</tr>
<% }%>
</table>
The above is my aspx. I am getting the error[NewLine in Constant] in this line (in the starting symbol)
<% if(ViewData["CustomerInfoList"]..........
In this line itself, i am getting "; Expected","IDentifier Expected","Invalid Expression Term" and "NewLine in Constant".
How to solve this.
来源:https://stackoverflow.com/questions/4254323/newline-in-constant-in-aspx-page