当我定义了一个新的资源文件时,我遇到了 HeaderText 没有被翻译的问题。所有其他文本都翻译但不是 HeaderText,即使是 TemplateField.HeaderText 也被翻译了。
<asp:GridView ID="GridView1" runat="server"
PageSize="25" GridLines="None"
AutoGenerateColumns="False" Width="100%"
meta:resourcekey="GridView1Resource1">
<AlternatingRowStyle CssClass="alt" />
<Columns>
<asp:BoundField DataField="Title" HeaderText="Title"
meta:resourcekey="BoundFieldResource1" />
<asp:BoundField DataField="Created" HeaderText="Skapad"
meta:resourcekey="BoundFieldResource2" />
<asp:BoundField DataField="CreatedBy" HeaderText="Skapad av"
meta:resourcekey="BoundFieldResource3" />
<asp:TemplateField HeaderText="Till" meta:resourcekey="TemplateFieldResource1">
<ItemTemplate>
<asp:Label ID="lblTo" runat="server" Text="Till"
meta:resourcekey="lblToResource1" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="TemplateFieldResource2">
<ItemTemplate>
<asp:HyperLink ID="hplPopup" runat="server" Text="Öppna"
meta:resourcekey="hplPopupResource1"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle CssClass="foot" />
<PagerStyle CssClass="pager" />
<SelectedRowStyle CssClass="selected" />
</asp:GridView>