How to localize HeaderText in GridView or validation controls?

Posted by Janusz on Stack Overflow See other posts from Stack Overflow or by Janusz
Published on 2010-06-06T14:36:30Z Indexed on 2010/06/06 14:42 UTC
Read the original article Hit count: 484

Filed under:
|

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 validation 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!

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about localization