PagerStyle Class
Provides style capability.
public class System.Web.UI.MobileControls.PagerStyle :
System.Web.UI.MobileControls.Style
Remarks
The PagerStyle object is a Style object with additional style properties specific to the pagination user interface (UI) of a form. Use the properties and methods of the PagerStyle class to override default text for NextPageText, PreviousPageText, and PageLabel properties. For example, if you are programmatically creating a form with Next and Previous links to the appropriate pages, you can override the text for these links by setting the value of the properties previously mentioned. You can use methods, such as GetNextPageText, GetPreviousPageText, or GetPageLabel to retrieve the current value of the properties.
Note The PageLabel property applies only to HTML and is not rendered for WML.
Example
This example shows the usage of PagerStyle class.
<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage"
Language="c#" Debug="true" %>
<script runat=server language="c#">
void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
Form1.PagerStyle.NextPageText = "2";
}
Form1.PagerStyle.StyleReference = "title";
Form1.PagerStyle.PageLabel = "Go to page";
ArrayList lblArr = new ArrayList() ;
for(int i=0;i<200;i++)
{
lblArr.Add(new System.Web.UI.MobileControls.Label());
((System.Web.UI.MobileControls.Label)lblArr[i]).Text =
"Hello" + i.ToString() ;
Form1.Controls.Add(((System.Web.UI.MobileControls.Label)
lblArr[i]));
}
}
void Form1_PageIndexChanged(object sender, EventArgs e)
{
Form1.PagerStyle.PreviousPageText =
(Form1.CurrentPage - 1).ToString () ;
Form1.PagerStyle.NextPageText =
(Form1.CurrentPage + 1).ToString () ;
}
</script>
<mobile:Stylesheet runat=server>
<Style Name= "FormStyle">
<DeviceSpecific>
<Choice>
<HeaderTemplate>
<mobile:link runat=server Text=
"Click to browse to the third page"
NavigateURL = "javascript:__doPostBack('Form1','4')" />
</HeaderTemplate>
<FooterTemplate>
<mobile:link runat=server Text=
"Click to browse to the first page"
NavigateURL = "javascript:__doPostBack('Form1','1')" />
</FooterTemplate>
</Choice>
</DeviceSpecific>
</Style>
</mobile:StyleSheet>
<mobile:Form id="Form1" runat="server" Paginate=true
OnPaginated="Form1_PageIndexChanged"
StyleReference="FormStyle">
</mobile:Form>
Requirements
Namespace: System.Mobile.Web.UI.MobileControls
Assembly: System.Web.Mobile