AspNetPager分页控件--使用方法5

时间:2010-01-29 13:28:27  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:ot;%>   ///<%@ Import Namespace="System.Data"%>   ///<%@ Page Language="C#" debug=true%>   ///<HTML>   /// <HEAD>   /// <TITLE>Welcome to Webdiyer.com </TITLE>   /// <script runat="server">...
  正文:/// <code><![CDATA[
  ///<%@Register TagPrefix="Webdiyer" Namespace="Wuqi.Webdiyer" Assembly="ASP/ target=_blank class=infotextkey>aspnetpager"%>
  ///<%@Import Namespace="System.Data.OleDb"%>
  ///<%@ Import Namespace="System.Data"%>
  ///<%@ Page Language="C#" debug=true%>
  ///<HTML>
  /// <HEAD>
  /// <TITLE>Welcome to Webdiyer.com </TITLE>
  /// <script runat="server">
  /// OleDbConnection conn;
  /// OleDbCommand cmd;
  /// void Page_Load(object src,EventArgs e){
  /// conn=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("access/aspnetpager.mdb"));
  /// if(!Page.IsPostBack){
  /// cmd=new OleDbCommand("select count(newsid) from wqnews",conn);
  /// conn.Open();
  /// pager.RecordCount=(int)cmd.ExecuteScalar();
  /// conn.Close();
  /// BindData();
  /// }
  /// }
  ///
  /// void BindData(){
  /// cmd=new OleDbCommand("select newsid,heading,source,addtime from wqnews order by addtime desc",conn);
  /// OleDbDataAdapter adapter=new OleDbDataAdapter(cmd);
  /// DataSet ds=new DataSet();
  /// adapter.Fill(ds,pager.PageSize*(pager.CurrentPageIndex-1),pager.PageSize,"news");
  /// dg.DataSource=ds.Tables["news"];
  /// dg.DataBind();
  /// }
  ///
  /// void ChangePage(object src,PageChangedEventArgs e){
  /// pager.CurrentPageIndex=e.NewPageIndex;
  /// BindData();
  /// }
  ///
  /// </script>
  /// <meta http-equiv="Content-Language" content="zh-cn">
  /// <meta http-equiv="content-type" content="text/html;charset=gb2312">
  /// <META NAME="Generator" CONTENT="EditPlus">
  /// <META NAME="Author" CONTENT="Webdiyer(yhaili@21cn.com)">
  /// </HEAD>
  /// <body>
  /// <form runat="server" ID="Form1">
  /// <h2 align="center">AspNetPager分页示例</h2>
  /// <asp:DataGrid id="dg" runat="server"
  /// Width="760" CellPadding="4" Align="center" />
  ///
  /// <Webdiyer:AspNetPager runat="server" id="pager"
  /// OnPageChanged="ChangePage"
  /// HorizontalAlign="center"
  /// style="MARGIN-TOP:10px;FONT-SIZE:16px"
  /// PageSize="8"
  /// ShowInputBox="always"
  /// SubmitButtonStyle="border:1px solid #000066;height:20px;width:30px"
  /// InputBoxStyle="border:1px #0000FF solid;text-align:center"
  /// SubmitButtonText="转到"
  /// UrlPaging="true"
  /// UrlPageIndexName="pageindex" />
  /// </form>
  /// </body>
  ///</HTML>
  /// ]]></code>
  /// </example>
  [Browsable(true),
  Category("分页"),
  DefaultValue(false),

"AspNetPager分页控件--使用方法5"由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Programming/aspnet/12599.html


关键字:

关于《AspNetPager分页控件--使用方法5》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td