Beef Brisket News Release System summary--website Publishing and pagination Production _ website release

Source: Internet
Author: User

Beef Brisket News Release system video watched for nearly half a month, today successfully released it, haha. The first time to watch teaching video so focused, do not take thinking, very good. Give the calf teacher a compliment, hehe.

To get to the point, every time we finish a stage, the most important is summed up, so let me in reverse form, Shing bar. The release of Beef Brisket Press release system

Reference blog:

Installation and configuration of IIS under Win7

Http://www.jb51.net/article/29787.htm

VS2010 Website Release detailed

http://wanghaitaoboke.blog.163.com/blog/static/1708725122012527716235/

Handler "pagehandlerfactory-integrated" has an error module "Managedpipelinehandler" in its module list

Making of http://blog.csdn.net/mazhaojuan/article/details/7660657 paging

Stored procedures:

   --=============================================
   --Author:		xuchenyang
   --Create Date:      2014-9-3 22:31:21
   --Description:	Paging Stored Procedures-
   -=============================================
   Create PROCEDURE [dbo]. [News_selectbypage]
   @startIndex int,
   @endIndex int
   as
   BEGIN with Temptbl as
   (
   SELECT row_number ()-by ID Desc as row,* from news 
  
   )
   SELECT * to Temptbl where Row between @startIndex and @endIndex end

   

DAL:

      #region Select Paging Records public
         DataTable Selectnewsbypage (String StartIndex, String endindex)
        {
           
            DataTable dt=new DataTable ();
            String cmdtext = "News_selectbypage";
            Sqlparameter[] paras = new sqlparameter[] {new SqlParameter ("@startIndex", StartIndex),
            new SqlParameter ("@ Endindex ", Endindex)};
            DT = SqlHelper. Excutequery (Cmdtext, paras, commandtype.storedprocedure);
            return dt;

        }
      #endregion


Bll:

      #region Paging Select Record public
        DataTable selectnewsbypage (String startIndex, String endindex)
        {return
            Ndao. Selectnewsbypage (Startindex,endindex);
        }
      #endregion


Web:

Open admin/newsmanager.aspx:

Right-click in the Toolbox space--"Select item"--Browse--Find the downloaded aspnetpager.dll--drag onto the page

      <div>
            <webdiyer:aspnetpager id= "ANP" runat= "Server" onpagechanged= "anp_pagechanged" pagesize= "5" CssClass = "ANP" >
            </webdiyer:AspNetPager>
      </div>

      protected void Page_Load (object sender, EventArgs e) {//Determine if administrator if (session["admin" in session) ]!= null && session["admin". ToString () = = "Niunan") {//Logged in if (!) Page.IsPostBack) {//Set the total number of record bars for the paging control (total record bar/number of records per page pagesize= pages) ANP. RecordCount = new Newsmanager (). SelectAll ().
                Rows.Count;
                
            Binding news Bindnews ();
        } else {//not logged in Response.Redirect ("Login.aspx"); #region Bound News list private void Bindnews () {//Select the news from the database and bind to the control based on the ordinal number of the beginning and ending records of the current page Epnews.datasource = new Newsmanager (). Selectnewsbypage (ANP. Startrecordindex.tostring (), ANP. 
        Endrecordindex.tostring ());
    Repnews.databind ();  #endregion protected void Anp_pagechanged (object sender, EventArgs e) {//response.write ("Start record:" + Anp. StartrEcordindex + "<br> End record number" + ANP.
        Endrecordindex);
    Update the bound News Bindnews () when the current page is switched; }

CSS style:

     . ANP
     {
   
      padding-left:200px;}

Effect Chart:

The above content is very basic, but it is important to keep accumulating, trying and exploring.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.