Singaravel Vela

Singaravel Vela

  • NA
  • 120
  • 13.7k

Expected a "{" but found a "<". Block statements must be

Nov 15 2018 5:45 AM
Hi,
 
I am getting the error  while i am call the Partial View.
 
Expected a "{" but found a "<". Block statements must be enclosed in "{" and "}". You cannot use single-statement control-flow statements in CSHTML pages.
 
 my partial view Code is
  1. <table cellpadding="0" cellspacing="0" id="SearchResultTable" class="table table-striped table-bordered nowrap" style="width:100%">  
  2.     <thead>  
  3.         <tr>  
  4.             @foreach (var col in Model.Columns)  
  5.             {  
  6.                 if (jsonString != string.Empty)  
  7.                 {  
  8.                     jsonString = jsonString + "$$$";  
  9.                 }  
  10.                 jsonString = jsonString + col.Name;  
  11.                 <th>@col.DisplayName</th>  
  12.             }  
  13.   
  14.             @if (Model.IsEdit)            
  15.                 <th>Edit</th>  
  16.           
  17.             @if (Model.IsDelete)
  18.                 <th>Delete</th>  
  19.           
  20.             @if (Model.IsView)
  21.                 <th>View</th>  
  22.          
  23.   
  24.             @if (Model.IsPrint)
  25.                 <th>Print</th>  
  26.   
  27.             </tr>  
  28.         </thead>  
  29.     </table> 
 

Answers (1)