NumericPagerField.NextPageImageUrl 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置为 NumericPagerField 对象中的下一页按钮显示的图像的 URL。
public:
property System::String ^ NextPageImageUrl { System::String ^ get(); void set(System::String ^ value); };
public string NextPageImageUrl { get; set; }
member this.NextPageImageUrl : string with get, set
Public Property NextPageImageUrl As String
属性值
为 NumericPagerField 对象中的下一页按钮显示的图像的 URL。 默认值为空字符串 (""),表示尚未设置 NextPageImageUrl 属性。
示例
以下示例演示如何在控件的 对象DataPager中NumericPagerField显示下一页按钮的图像。
<%@ 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 id="Head1" runat="server">
<title>NumericPagerField Example</title>
<style type="text/css">
.header { background-color:#8FBC8F; }
table { border: solid 1px #000000; }
</style>
</head>
<body>
<form id="form1" runat="server">
<h3>NumericPagerField Example</h3>
<asp:ListView ID="VendorsListView"
DataSourceID="VendorsDataSource"
runat="server">
<LayoutTemplate>
<table cellpadding="2" width="640px" runat="server" id="tblVendor">
<tr align="center" class="header" runat="server">
<td runat="server">ID</td>
<td runat="server">Vendor Name</td>
<td runat="server">Active</td>
</tr>
<tr id="itemPlaceholder" runat="server">
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr runat="server">
<td>
<asp:Label ID="VendorIDLabel" runat="server" Text='<%#Eval("VendorID") %>' />
</td>
<td>
<asp:Label ID="NameLabel" runat="server" Text='<%#Eval("Name") %>' />
</td>
<td align="center">
<asp:CheckBox ID="ActiveFlagCheck" runat="server"
Checked='<%#Eval("ActiveFlag") %>'
Enabled="false" />
</td>
</tr>
</ItemTemplate>
</asp:ListView>
<asp:DataPager runat="server" ID="ContactsDataPager"
PagedControlID="VendorsListView"
PageSize="10">
<Fields>
<asp:NumericPagerField
NextPageImageUrl="~/images/next.gif"
PreviousPageImageUrl="~/images/previous.gif"
ButtonType="Image" />
</Fields>
</asp:DataPager>
<!-- This example uses Microsoft SQL Server and connects -->
<!-- to the AdventureWorks sample database. Use an ASP.NET -->
<!-- expression to retrieve the connection string value -->
<!-- from the Web.config file. -->
<asp:SqlDataSource ID="VendorsDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:AdventureWorks_DataConnectionString %>"
SelectCommand="SELECT [VendorID], [Name], [ActiveFlag] FROM Purchasing.Vendor">
</asp:SqlDataSource>
</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 id="Head1" runat="server">
<title>NumericPagerField Example</title>
<style type="text/css">
.header { background-color:#8FBC8F; }
table { border: solid 1px #000000; }
</style>
</head>
<body>
<form id="form1" runat="server">
<h3>NumericPagerField Example</h3>
<asp:ListView ID="VendorsListView"
DataSourceID="VendorsDataSource"
runat="server">
<LayoutTemplate>
<table cellpadding="2" width="640px" runat="server" id="tblVendor">
<tr align="center" class="header" runat="server">
<td runat="server">ID</td>
<td runat="server">Vendor Name</td>
<td runat="server">Active</td>
</tr>
<tr id="itemPlaceholder" runat="server">
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr runat="server">
<td>
<asp:Label ID="VendorIDLabel" runat="server" Text='<%#Eval("VendorID") %>' />
</td>
<td>
<asp:Label ID="NameLabel" runat="server" Text='<%#Eval("Name") %>' />
</td>
<td align="center">
<asp:CheckBox ID="ActiveFlagCheck" runat="server"
Checked='<%#Eval("ActiveFlag") %>'
Enabled="false" />
</td>
</tr>
</ItemTemplate>
</asp:ListView>
<asp:DataPager runat="server" ID="ContactsDataPager"
PagedControlID="VendorsListView"
PageSize="10">
<Fields>
<asp:NumericPagerField
NextPageImageUrl="~/images/next.gif"
PreviousPageImageUrl="~/images/previous.gif"
ButtonType="Image" />
</Fields>
</asp:DataPager>
<!-- This example uses Microsoft SQL Server and connects -->
<!-- to the AdventureWorks sample database. Use an ASP.NET -->
<!-- expression to retrieve the connection string value -->
<!-- from the Web.config file. -->
<asp:SqlDataSource ID="VendorsDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:AdventureWorks_DataConnectionString %>"
SelectCommand="SELECT [VendorID], [Name], [ActiveFlag] FROM Purchasing.Vendor">
</asp:SqlDataSource>
</form>
</body>
</html>
注解
当 属性 ButtonType 设置为 ButtonType.Image时,使用 NextPageImageUrl 属性指定为下一页按钮显示的图像的 URL。 图像可以采用浏览器支持的任何文件格式,例如 .jpg、.gif、.bmp 和 .png。
当 属性 ButtonType 设置为 以外的 ButtonType.Image值时,设置 属性 NextPageImageUrl 不起作用。
此属性的值存储在视图状态中。