2013-04-01 36 views
2

我正在使用第三方組件(IPagedList)來實現分頁。一切正常,我只是需要本地化的消息例如IPagedList本地化

Showing items 11 through 11 of 11. 

此消息文本是用PagedListRenderOptions.MinimalWithItemCountText

+0

檢查[這裏]( https://github.com/TroyGoode/PagedList/blob/master/src/PagedList.Mvc/PagedListRenderOptions.cs) –

回答

1

使用下面的代碼來設置自定義的本地化的格式生成:

var options = new PagedListRenderOptions(); 
options.PageCountAndCurrentLocationFormat = "Page {0} of {1}."; //your custom string goes gere 
options.ItemSliceAndTotalFormat = "Showing items {0} through {1} of {2}.";