I'm trying to allow my users to decide what rows from the database they want to see in the datagrid so I have a page where they can set that, but when I try to read those values from the database and try to set the columns to those values I get an error. This is how I am doing it:
Code:
<asp:BoundColumn DataField="<%=Session("sys_header1")%>" SortExpression="<%=Session("sys_header1")%> asc" HeaderText="<%=Session("header1")%>">
<HeaderStyle Font-Size="XX-Small" Font-Names="Microsoft Sans Serif" Font-Bold="True" Wrap="False"></HeaderStyle>
<ItemStyle Font-Size="XX-Small" Font-Names="MS Sans Serif" Wrap="False" HorizontalAlign="Center"></ItemStyle>
</asp:BoundColumn>
But I get this error: Parser Error Message: Literal content ('<asp:BoundColumn DataField="') is not allowed within a 'System.Web.UI.WebControls.DataGridColumnCollection'.
