I am using an inline if condition in a grid which is based on a bound field and another field. While implementing the if condition in Eval statement, i am getting an unknown error.
<telerik:GridTemplateColumn> |
<ItemTemplate> |
<table class="search_results_new" border="0" cellpadding="0" cellspacing="0"> |
<tr class="suggestionResults" title="select to edit suggestion"> |
<td> |
<% if (ViewData["UserLevelBySCDS"].ToString() == "1" || (ViewData["UserLevelBySCDS"].ToString() == "2" && Eval("ResourceCategoryID").ToString() == "1") || (ViewData["UserLevelBySCDS"].ToString() == "4" && Eval("ResourceCategoryID").ToString() == "2")) // |
{ %> |
<!-- Delete Suggestion Original--> |
Res Cat Id: <%# Eval("ResourceCategoryID").ToString() == "1" ? "Xplore" : "District" %> <!-- Temporary line --> |
<input id="hfResourceCategoryID" name="hfResourceCategoryID" type="hidden" value='<%# Eval("ResourceCategoryID")%>' /> |
<div id="deleteSuggestion" class="deleteSuggestion"> |
<input id="hfSuggestionID" type="hidden" value='<%# Eval("SuggestionID") %>' /> |
</div> |
<%# Html.ActionLink("-", "Edit", new { pID = Eval("SuggestionID") }, new { id = "A1", @class = "editMyResource", style="display: inline;" }) %> |
<!-- End of Delete Suggestion --> |
<% } %> |
<span> |
<a href='<%# Eval("Link")%>' target="_blank"> |
<%# Eval("ResourceType.Description")%> |
</a> |
<br /> |
<b> |
<div onclick="window.open('<%# Eval("Link")%>')"> |
<u> |
<%# Eval("Link")%></u> |
</div> |
</b> |
</span> |
<i> |
<div class="rating" id="mainStarDiv"> |
<input id="hfSuggestionID" name="hfSuggestionID" type="hidden" value='<%# Eval("SuggestionID")%>' /> |
<input id="hfDefaultRating" type="hidden" value='<%# Eval("Rank")%>' /> |
<div class="star" id="star1" starrank="1"> |
<a href="javascript:void(0);" style="width: 100%;">1</a></div> |
<div class="star" id="star2" starrank="2"> |
<a href="javascript:void(0);" style="width: 100%;">2</a></div> |
<div class="star" id="star3" starrank="3"> |
<a href="javascript:void(0);" style="width: 100%;">3</a></div> |
<div class="star" id="star4" starrank="4"> |
<a href="javascript:void(0);" style="width: 100%;">4</a></div> |
<div class="star" id="star5" starrank="5"> |
<a href="javascript:void(0);" style="width: 100%;">5</a></div> |
</div> |
</i> |
</td> |
</tr> |
</table> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
Please note that i am implementing this grid in MVC and please do not refer me to use Telerik MVC Grid.