資源簡介
基于ASP.NET的博客系統源代碼 BLOG
代碼片段和文件信息
using?System;
using?System.Collections;
using?System.Configuration;
using?System.Data;
using?System.Linq;
using?System.Web;
using?System.Web.Security;
using?System.Web.UI;
using?System.Web.UI.WebControls;
using?System.Web.UI.WebControls.WebParts;
using?System.Web.UI.HtmlControls;
using?System.xml.Linq;
using?System.Data.SqlClient;
namespace?Web
{
????public?partial?class?Blog?:?System.Web.UI.Page
????{
????????protected?void?Page_Load(object?sender?EventArgs?e)
????????{
????????????if?(!IsPostBack)
????????????{
????????????????dlbind();
????????????}
????????}
????????#region
????????///?
????????///?分頁
????????///?
????????public?void?dlbind()
????????{
????????????int?curpage?=?Convert.ToInt32(lb_currentpage.Text);
????????????string?conn?=?ConfigurationManager.ConnectionStrings[“Conneciton“].ConnectionString;
????????????SqlDataAdapter?da?=?new?SqlDataAdapter(“select?top?50?*?from?News?where?issave=0?and?isdel=0“?conn);
????????????DataSet?ds?=?new?DataSet();
????????????da.Fill(ds?“news“);
????????????PagedDataSource?ps?=?new?PagedDataSource();
????????????ps.DataSource?=?ds.Tables[“news“].DefaultView;
????????????ps.AllowPaging?=?true;
????????????ps.PageSize?=?3;
????????????ps.CurrentPageIndex?=?curpage?-?1;
????????????lb_page.Text?=?Convert.ToString(ps.PageCount);
????????????if?(!IsPostBack)
????????????{
????????????????for?(int?i?=?1;?i?<=?ps.PageCount;?i++)
????????????????{
????????????????????DropDownList1.Items.Add(i.ToString());
????????????????}
????????????????DropDownList1.SelectedItem.Text?=?curpage.ToString();
????????????}
????????????lbtn_frist.Enabled?=?true;
????????????lbtn_up.Enabled?=?true;
????????????lbtn_down.Enabled?=?true;
????????????lbtn_last.Enabled?=?true;
????????????if?(curpage?==?1)
????????????{
????????????????lbtn_frist.Enabled?=?false;
????????????????lbtn_up.Enabled?=?false;
????????????}
????????????if?(curpage?==?ps.PageCount)
????????????{
????????????????lbtn_down.Enabled?=?false;
????????????????lbtn_last.Enabled?=?false;
????????????}
????????????Repeater1.DataSource?=?ps;
????????????Repeater1.DataBind();
????????}
????????protected?void?lbtn_frist_Click(object?sender?EventArgs?e)
????????{
????????????lb_currentpage.Text?=?“1“;
????????????dlbind();
????????}
????????protected?void?lbtn_up_Click(object?sender?EventArgs?e)
????????{
????????????lb_currentpage.Text?=?Convert.ToString(Convert.ToInt32(lb_currentpage.Text)?-?1);
????????????dlbind();
????????}
????????protected?void?lbtn_down_Click(object?sender?EventArgs?e)
????????{
????????????lb_currentpage.Text?=?Convert.ToString(Convert.ToInt32(lb_currentpage.Text)?+?1);
????????????dlbind();
????????}
????????protected?void?lbtn_last_Click(object?sender?EventArgs?e)
????????{
????????????lb_currentpage.Text?=?lb_page.Text;
????????????dlbind();
????????}
????????protected?void?DropDownList1_SelectedIndexChanged(object
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1585??2010-11-30?20:34??asp.net博客網站\博客網站\Blog.sln
????..A..H.????182784??2012-12-02?11:35??asp.net博客網站\博客網站\Blog.suo
?????文件?????????33??2010-12-01?11:35??asp.net博客網站\博客網站\read?me.txt
?????文件????2031616??2012-12-08?17:35??asp.net博客網站\博客網站\Web\App_Data\Blog_Data.MDF
?????文件????1048576??2012-12-08?17:35??asp.net博客網站\博客網站\Web\App_Data\Blog_Log.LDF
?????文件?????110592??2008-01-26?22:17??asp.net博客網站\博客網站\Web\bin\AspNetPager.dll
?????文件?????589824??2007-05-10?01:14??asp.net博客網站\博客網站\Web\bin\CuteEditor.dll
?????文件????????128??2007-06-13?14:08??asp.net博客網站\博客網站\Web\bin\cuteeditor.lic
?????文件??????67072??2012-12-02?09:52??asp.net博客網站\博客網站\Web\bin\Web.dll
?????文件?????345600??2012-12-02?09:52??asp.net博客網站\博客網站\Web\bin\Web.pdb
?????文件???????2183??2010-11-25?16:10??asp.net博客網站\博客網站\Web\Blog.aspx
?????文件???????3469??2010-11-27?15:16??asp.net博客網站\博客網站\Web\Blog.aspx.cs
?????文件???????3566??2010-11-25?13:34??asp.net博客網站\博客網站\Web\Blog.aspx.designer.cs
?????文件??????15843??2010-11-30?21:52??asp.net博客網站\博客網站\Web\BlogDataClasses.dbml
?????文件???????2656??2010-11-30?21:52??asp.net博客網站\博客網站\Web\BlogDataClasses.dbml.layout
?????文件??????57571??2010-11-30?21:52??asp.net博客網站\博客網站\Web\BlogDataClasses.designer.cs
?????文件????2031616??2012-12-02?09:48??asp.net博客網站\博客網站\Web\Blog_Data.MDF
?????文件???????3977??2010-12-02?11:26??asp.net博客網站\博客網站\Web\Controls\huifu.ascx
?????文件???????2913??2010-11-30?21:21??asp.net博客網站\博客網站\Web\Controls\huifu.ascx.cs
?????文件???????5686??2010-11-27?13:40??asp.net博客網站\博客網站\Web\Controls\huifu.ascx.designer.cs
?????文件???????1456??2010-11-25?16:15??asp.net博客網站\博客網站\Web\Controls\LeftList.ascx
?????文件???????1158??2010-11-30?21:21??asp.net博客網站\博客網站\Web\Controls\LeftList.ascx.cs
?????文件????????806??2010-11-06?22:42??asp.net博客網站\博客網站\Web\Controls\LeftList.ascx.designer.cs
?????文件???????2558??2010-11-27?13:45??asp.net博客網站\博客網站\Web\Controls\liuyan.ascx
?????文件???????3140??2010-11-27?14:50??asp.net博客網站\博客網站\Web\Controls\liuyan.ascx.cs
?????文件???????3253??2010-11-07?00:17??asp.net博客網站\博客網站\Web\Controls\liuyan.ascx.designer.cs
?????文件????????233??2012-12-02?11:00??asp.net博客網站\博客網站\Web\Controls\User.ascx
?????文件????????520??2009-08-17?11:25??asp.net博客網站\博客網站\Web\Controls\User.ascx.cs
?????文件????????465??2010-11-25?15:33??asp.net博客網站\博客網站\Web\Controls\User.ascx.designer.cs
?????文件???????8323??2010-11-30?20:57??asp.net博客網站\博客網站\Web\css\AC_RunActiveContent.js
............此處省略2698個文件信息
評論
共有 條評論