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.