I am adding a button in the header of the grid view but Visual Studio highlights this asn an error:
'The name EVAL does not exist in the current context'.
Why does this happen, and how can it be solved?
<asp:gridview runat="server" >
<Columns>
.....
<asp:TemplateField>
<ItemTemplate>
<asp:Literal runat="server" ID="litFamily" Text='<%# EVAL("CompanyAddress") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
.....
Use either
<%# DataBinder.Eval(Container.DataItem, "CompanyAddress")%>
<%# Eval("CompanyAddress") %>
Use 'Eval' (E -> capital letter, val > small letters) in place of 'EVAL' (all capital letters)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With