在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
一、.ascx页面 复制代码 代码如下: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Pagination.ascx.cs" Inherits="IOCS.WEB.UserControl.Pagination" %> <link href="../Content/Css/Pager.css" rel="stylesheet" type="text/css" /> <div id="tbPage" class="pager" runat="server" > 記錄總數:<asp:Label ID="LRecords" runat="server"></asp:Label> 總頁數:<asp:Label ID="LPages" runat="server"></asp:Label> 當前頁:<asp:Label ID="LPage" runat="server"></asp:Label> <asp:LinkButton ID="LinkFirst" runat="server" CommandArgument="first" nClick="PagerButtonClick" Text="首頁"></asp:LinkButton> <asp:LinkButton ID="LinkPrevious" runat="server" CommandArgument="prev" nClick="PagerButtonClick" Text="上一頁"></asp:LinkButton> <asp:LinkButton ID="LinkNext" runat="server" CommandArgument="next" nClick="PagerButtonClick" Text="下一頁"></asp:LinkButton> <asp:LinkButton ID="LinkLast" runat="server" CommandArgument="last" nClick="PagerButtonClick" Text="末頁"></asp:LinkButton> 轉到第<asp:TextBox ID="txtpage" CssClass="piut" runat="server" MaxLength="5" AutoPostBack="True" nTextChanged="txtpage_TextChanged"></asp:TextBox>頁 二、.ascx.cs文件 复制代码 代码如下: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace IOCS.WEB.UserControl } } /// <summary> protected void PagerButtonClick(object sender, EventArgs e) default: }
public void SetPageButton()
object s = LinkFirst.Style.Keys; /// <summary> public void SetPageRecord(int dsCount) protected void txtpage_TextChanged(object sender, EventArgs e) Page.ClientScript.RegisterStartupScript(this.GetType(), "Script", "<script. language='javascript'>alert('對不起,只能輸入數字!');</script>"); |
请发表评论