开发者

How to localize HeaderText in GridView or validation controls?

开发者 https://www.devze.com 2023-01-02 17:08 出处:网络
I cannot figure out why HeaderText or validation controls always fallback to default culture - even though rest of the controls are in correct culture.

I cannot figure out why HeaderText or validation controls always fallback to default culture - even though rest of the controls are in correct culture.

I have a GridView with HeaderText specified in this way>

<asp:BoundField DataField="totalSales" HeaderText="<%$ Resources:Strings,TotalSales %>" />

In the same way I have va开发者_如何学Pythonlidation controls and they can't be localized.

Only this syntax does work: <%= Resources.Strings.Payments %>

I set different culture in Master page using this statement in Page_Init

Me.Page.Culture = "pl-PL"
Me.Page.UICulture = "pl-PL"

Can anyone spot what's wrong? I have been Googling it for last few days without success.

Thanks!


Have you tried to use ExpressionBuilder? That works very well and allows you to localize everything using the same approach.

0

精彩评论

暂无评论...
验证码 换一张
取 消