PagerSettings.NextPageText 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置为下一页按钮显示的文字。
public:
property System::String ^ NextPageText { System::String ^ get(); void set(System::String ^ value); };
public string NextPageText { get; set; }
member this.NextPageText : string with get, set
Public Property NextPageText As String
属性值
为下一页按钮显示的文字。 默认值为“>”
,呈现为“>”。
示例
下面的代码示例演示如何使用 NextPageText 属性自定义控件中 GridView 寻呼行的下一页按钮显示的文本。
<%@ Page language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>PagerSetting Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>PagerSetting Example</h3>
<asp:gridview id="CustomerGridView"
datasourceid="CustomerDataSource"
autogeneratecolumns="true"
datakeynames="CustomerID"
allowpaging="true"
runat="server">
<pagersettings mode="NextPreviousFirstLast"
firstpagetext="First"
lastpagetext="Last"
nextpagetext="Next"
previouspagetext="Prev"
position="Bottom"/>
</asp:gridview>
<br/>
<asp:label id="MessageLabel"
forecolor="Red"
runat="server"/>
<!-- This example uses Microsoft SQL Server and connects -->
<!-- to the Northwind sample database. Use an ASP.NET -->
<!-- expression to retrieve the connection string value -->
<!-- from the Web.config file. -->
<asp:sqldatasource id="CustomerDataSource"
selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
runat="server"/>
</form>
</body>
</html>
<%@ Page language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>PagerSetting Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>PagerSetting Example</h3>
<asp:gridview id="CustomerGridView"
datasourceid="CustomerDataSource"
autogeneratecolumns="true"
datakeynames="CustomerID"
allowpaging="true"
runat="server">
<pagersettings mode="NextPreviousFirstLast"
firstpagetext="First"
lastpagetext="Last"
nextpagetext="Next"
previouspagetext="Prev"
position="Bottom"/>
</asp:gridview>
<br/>
<asp:label id="MessageLabel"
forecolor="Red"
runat="server"/>
<!-- This example uses Microsoft SQL Server and connects -->
<!-- to the Northwind sample database. Use an ASP.NET -->
<!-- expression to retrieve the connection string value -->
<!-- from the Web.config file. -->
<asp:sqldatasource id="CustomerDataSource"
selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
runat="server"/>
</form>
</body>
</html>
注解
当属性 Mode 设置为 NumericFirstLast 或 NextPrevious 值时,请使用 NextPageText 该属性指定要为下一页按钮显示的文本。
备注
或者,可以通过设置 NextPageImageUrl 属性而不是 NextPageText 属性来显示下一页按钮的图像。 NextPageImageUrl如果同时设置了和NextPageText属性,则会显示NextPageText图像,该属性充当图像的备用文本。 在支持工具提示的浏览器中,此文本也显示为相应按钮的工具提示。
此属性的值存储在视图状态中。