Asp.net 如何放置<;%=%&燃气轮机;标记到asp gridview中

Asp.net 如何放置<;%=%&燃气轮机;标记到asp gridview中,asp.net,Asp.net,标题文本在站点上显示为,而不是实际值,有人知道修复方法吗?这不仅仅是标题值,所以您只需在其中添加一些自由文本,然后使用数据字段=scheduledLogsDateCaptionValue <asp:BoundField HeaderText='<%=scheduledLogsDateCaptionValue%>' DataField="DateString" ItemStyle-Width="15%" ItemStyle-cssclas

标题文本在站点上显示为
,而不是实际值,有人知道修复方法吗?

这不仅仅是标题值,所以您只需在其中添加一些自由文本,然后使用
数据字段=scheduledLogsDateCaptionValue

<asp:BoundField HeaderText='<%=scheduledLogsDateCaptionValue%>' 
      DataField="DateString" 
      ItemStyle-Width="15%" 
      ItemStyle-cssclass="logtd" 
      ItemStyle-HorizontalAlign="Right"/>

如果您想动态更改
网格视图的标题文本
,可以在代码隐藏中执行,如

<asp:BoundField HeaderText="Scheduled date" 
      DataField="scheduledLogsDateCaptionValue" 
      ItemStyle-Width="15%" 
      ItemStyle-cssclass="logtd" 
      ItemStyle-HorizontalAlign="Right"/>
Gridview1.Columns[ColumnIndex].HeaderText = ds.Tables[0].Rows[0]["scheduledLogsDateCaptionValue"].ToString();