A paging control

zhaozj2021-02-16  63

Pager.ascx

<% @ Control language = "c #" autoeventwireup = "false" codebehind = "Pager.ascx.cs" inherits = "Web.PagerControl" targetschema = "http://schemas.microsoft.com/intelliSense/ie5"%> var CurrentPage = <% = PageIndex%>; // Current Section VAR P = <% = PageIndex%> - 1; var sum = <% = sum%> VAR perpage = <% = perpage%> var Urlstr = '<% = URLSTR%>'; var fontcolor = '<% = fontcolor%>'; // n Represents a total of how many page IF (SUM% perpage == 0) {n = sum / perpage;} else {n = (SUM-SUM% perpage) / perpage 1;} Document.write ('

'); Document.write (' "); document.write ('
); Document.write ('page: ' currentpage ' / n " page per page per page " perpage Total: ' sum ' strip data '); Document.write ('
Page: '); IF CurrentPage == 1) {document.write (' 9 ');} else {document.write (' 9 );

} If (CurrentPage> 10) {document.write (' 7 ');} Document.write (' ); for (i = pp% 10 1; i ' i ' ');} else {document.write (' < A href = "' urlstr ' & Page = ' i '"> ' i ' ');}} Document.write (' '); if (n-currentpage> 10) { Document.write (' 8 ' }}} {Document.write (': ');} else {document.write (' : ');} Document.write (' Go: '); Document.write (' '); Document.write (' '); Pager.ascx.cs

namespace Web {using System; using System.Data; using System.Drawing; using System.Web; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; ///

/// pager1 of Abstract. /// public class pagercontrol: System.Web.UI.UserControl {public string urlstr = "page.aspx"; public int pageindex = 1; public int sum = 20; public int perpage = 20; public string tablewidth = "100%"; public string fontcolor = "black"; private void page_load (object sender, system.eventargs e) {// Place user code here to initialize the page

}

#Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // initializeComponent (); base.oninit (e);} ///

/// Designer Support required method - Do not use code editor // to modify the contents of this method. /// private void initializecomponent () {this.load = new system.eventhandler (this.page_load);} #ENDREGON}}

转载请注明原文地址:https://www.9cbs.com/read-21861.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.041, SQL: 9