Firstly, here is my aspx:
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="EntityDataSourceTeklifler">
<ItemTemplate>
<div class="panel panel-primary">
<div class="panel-body">
<strong>Teklif No.</strong> <%#Eval("TeklifId") %><br />
<strong>Teklif Tarihi:</strong> <%#Eval("TeklifTarih") %><br />
<strong>Teklifi Hazırlayan:</strong> <%#Eval("Name") %> <%#Eval("Surname") %><br />
<strong>Firma Adı:</strong> <%#Eval("FirmaAdi") %><br />
<strong>Ürünler:</strong><br />
<%#Eval("TeklifSiparis") %>
<strong>Genel Toplam:</strong> <%#Eval("TeklifTutar") %>$<br />
<strong>Not:</strong><br />
<%#Eval("TeklifNot") %><br />
<strong>Teklif Durumu:</strong> <%# CheckIfApproved(Eval("Approved")) %>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
As you can see I am trying to call a method in the last item of the repeater. Here is my code-behind method:
protected string CheckIfApproved(bool isApproved)
{
string result;
if (isApproved)
{
result = "Satışa Dönmüştür";
}
else
{
result = "Satışa Dönmemiştir";
}
return result;
}
When I run the code I get an error like 'Compile Error' with no detailed explanation in the method calling eval line. What am I doing wrong ?
stringas param to your method when it's expecting aboolvalue