編集、削除、追加オプションを使用して編集可能なグリッドビューを表示しているasp.netアプリケーションがあります。このグリッドには通常のテンプレート フィールドがあります。静的文字列変数を持つ静的クラスもあります。これらの静的変数の値をテンプレート フィールドのヘッダー テキストとして保持したいと考えています。したがって、定数クラスの名前空間を次のようにインポートしました。
<%@ Import Namespace="ConstantManagerNamespace" %>
次に、同じ列を試しました:
1. <asp:TemplateField HeaderText=<%=ConstantManager.Name%>>
2. <asp:TemplateField HeaderText='<%=ConstantManager.Name%>'>
3. <asp:TemplateField HeaderText=<% ConstantManager.Name %>>
4. <asp:TemplateField HeaderText='<% ConstantManager.Name%>'>
all probable syntax to access my constant variable value but
パーサー エラーが発生しました:
Literal content ('<asp:TemplateField HeaderText=') is not allowed within a 'System.Web.UI.WebControls.DataControlFieldCollection'.
これを行う方法 ?