Ananta Ghosh
Ananta Ghosh

Reputation: 1

Localization of Data Pager control in Asp.Net

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.

Upvotes: 0

Views: 74

Answers (1)

Selim Yildiz
Selim Yildiz

Reputation: 5370

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://learn.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.

Upvotes: 0

Related Questions