0
votes

Is it possible to localize DataPager control in asp.net?

Among the fields NextPreviousPagerField can be localized since it offers properties such as FirstPageText and LastPageText. But I am having trouble localizing NumericPagerField. It basically produces the page numbers and I can't find any way of localizing those.

I have tried changing the culture of current thread, but it didn't work.

1
Did you try PreviousPageText="<%$Resources:TestSiteResources, PreviousPageText %>"?Selim Yildiz

1 Answers

0
votes

There are also properties PreviousPageText and NextPageText in NumericPagerField control that can be localized as follows (Assuming you are using Resources):

<asp:NumericPagerField 
    PreviousPageText="<%$Resources:TestSiteResources, PreviousPageText %>"
    NextPageText="<%$Resources:TestSiteResources, NextPageText %>"
    ... />

Also note that:

https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.numericpagerfield.nextpagetext#remarks

The value of this property is stored in view state. It can be saved automatically to a resource file by using a designer tool. For more information, see LocalizableAttribute and Globalization and Localization.