问题
I have following code for gridview :
<asp:TemplateField HeaderText="N/A">
<ItemTemplate>
<asp:Label ID="lblENGNA" runat="server" Text='<%# Bind("N/A") %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
When i run this its giving me error for above section that:
Parser Error Message: A call to Bind was not well formatted. Please refer to documentation for the correct parameters to Bind.
Error Image:
Note: my query(which binds grid) contains field N/A
回答1:
I added [N/A] in bind and it worked.
Its as follows:
<asp:Label ID="lblENGNA" runat="server" Text='<%# Bind("[N/A]") %>'>
来源:https://stackoverflow.com/questions/18101105/gridview-error-a-call-to-bind-was-not-well-formatted