I’m trying to bind a bool from the server to the markup:
<asp:BoundField DataField="RevSharePercent" HeaderText="Revenue Share Percentage"
SortExpression="RevSharePrecentage" ReadOnly="<%=SetFieldsReadOnly%>" />
but rendering shows the following error:
Parser Error Message: Literal content ('<asp:BoundField
DataField="RevSharePercent" HeaderText="Revenue Share Percentage"
SortExpression="RevSharePrecentage" ReadOnly="') is not allowed within a
'System.Web.UI.WebControls.DataControlFieldCollection'.
Source Error:
Line 59:<AlternatingRowStyle BackColor="#E8E8E8" />
Line 60: <Fields>
Line 61: <asp:BoundField DataField="RevSharePercent" HeaderText="Revenue Share Percentage"
Line 62: SortExpression="RevSharePrecentage" ReadOnly="<%# Bind("SetFieldsReadOnly") %>" />
Line 63: <asp:BoundField DataField="ScreeningPercent" HeaderText="Screening Percentage"
SortExpression="ScreeningPercent" ReadOnly="<%# Bind("SetFieldsReadOnly") %>" />
update
Tried “<%#Bind(“SetFieldsReadOnly”) %>”
and ReadOnly=”<%#Eval(“SetFieldsReadOnly”) %>” />
both didn’t work
Parser Error Message: Literal content (‘
Source Error:
Line 59: Line 60: Line
61:
SortExpression=”RevSharePrecentage”
ReadOnly=”<%#Bind(“SetFieldsReadOnly”) %>” /> Line 63:
” />
I think you need to try:
or
rather than
note the Bind / Eval.
just found this information regarding syntax on another site
In ASP.NET 1.1 the databinding tags were:
ASP.NET 2.0 offer those as well as the following: