-
大小: 18KB文件類(lèi)型: .rar金幣: 2下載: 0 次發(fā)布日期: 2021-06-07
- 語(yǔ)言: C#
- 標(biāo)簽: Asp.Net??評(píng)論蓋樓??Ajax??
資源簡(jiǎn)介
Asp.Net實(shí)現(xiàn)評(píng)論蓋樓(含Ajax實(shí)現(xiàn)方式)
http://blog.csdn.net/a497785609/article/details/6642343

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Web.UI;
using?Bll;
using?Model;
public?partial?class?AjaxComment?:?Page
{
????protected?void?Page_Load(object?sender?EventArgs?e)
????{
????????string?action?=?Request.Form[“action“]????“init“;
????????int?page?=?Request.Form[“page“]?==?null???1?:?Convert.ToInt32(Request.Form[“page“]);
????????int?pageSize?=?Request.Form[“pageSize“]?==?null???5?:?Convert.ToInt32(Request.Form[“pageSize“]);
????????switch?(action.ToLower())
????????{
????????????case?“add“:
????????????????AddComments();
????????????????break;
????????????case?“init“:
????????????????InitComments(page?pageSize);
????????????????break;
????????????case?“pager“:
????????????????InitPagerStr(page?pageSize);
????????????????break;
????????}
????}
????public?void?AddComments()
????{
????????string?genneralId?=?Request.Form[“genneralId“];
????????string?commentId?=?Request.Form[“commentId“];
????????string?commenttitle?=?Request.Form[“commenttitle“];
????????string?commentContent?=?Request.Form[“commentContent“];
????????var?cmt?=?new?MultiLevelCommentInfo();
????????cmt.GenneralId?=?Convert.ToInt32(genneralId);
????????cmt.ReferenceId?=?Convert.ToInt32(commentId);
????????cmt.Content?=?commentContent;
????????cmt.PostDate?=?DateTime.Now;
????????cmt.UserName?=?commenttitle;
????????MultiLevelComment.Add(cmt);
????????Response.Clear();
????????Response.Write(“ok“);
????????Response.End();
????}
????public?void?InitComments(int?page?int?pageSize)
????{
????????string?outputStr?=?““;
????????//?List?list?=?MultiLevelComment.GetAllList(); //?獲取GenneralId為16的所有評(píng)論
????????List?list?=?MultiLevelComment.GetList(page?pageSize);
????????list.Sort(MultiLevelCommentInfo.GetComparer(false));?//?倒序排列
????????foreach?(MultiLevelCommentInfo?item?in?list)
????????{
????????????string?itemOutput?=?““;
????????????string?reference?=?““;
????????????var?quoteList?=?new?List();?//?創(chuàng)建當(dāng)前評(píng)論所引用的評(píng)論列表?
????????????MultiLevelComment.AddComment(list?quoteList?item);?//?為當(dāng)前評(píng)論的引用列表添加項(xiàng)目?
????????????quoteList.Sort(MultiLevelCommentInfo.GetComparer());?//?對(duì)列表排序,順序排列?
????????????foreach?(MultiLevelCommentInfo?quote?in?quoteList)?//?生成引用的評(píng)論列表
????????????{
????????????????string?template?=?““;
????????????????template?+=?String.Format(“???“)?+?Environment.NewLine;
????????????????template?+=
????????????????????String.Format(
????????????????????????“????????tle‘>{0}?發(fā)表于:{2}?評(píng)論ID:{1}“
????????????????????????quote.UserName?quote.Id?quote.PostDate.ToString(“yyyy-MM-dd?HH:mm:ss“))?+?Environment.NewLine;
????????????????template?+=?String.Format(“????????[$reference]{0}“?quote.Content)?+
????????????????????????????Environment.NewLine;
????????????????template?
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件???????1706??2014-04-26?08:36??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓.sln
????..A..H.?????21504??2014-04-26?14:06??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓.suo
?????文件????????438??2014-04-26?08:36??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\AjaxComment.aspx
?????文件???????9710??2014-04-26?14:06??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\AjaxComment.aspx.cs
?????文件????????643??2014-04-26?08:41??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\App_Code\Bll\CommentComparer.cs
?????文件???????6949??2014-04-26?14:06??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\App_Code\Bll\MultiLevelComment.cs
?????文件??????14306??2014-04-26?14:06??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\App_Code\Dal\MultiLevelComment.cs
?????文件???????2597??2014-04-26?14:00??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\App_Code\IDal\IMultiLevelComment.cs
?????文件???????1451??2014-04-26?14:06??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\App_Code\Model\MultiLevelCommentInfo.cs
?????文件???????6385??2014-04-26?14:06??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\Default.aspx
?????文件???????3740??2014-04-26?14:06??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\Default.aspx.cs
?????文件???????1652??2011-07-23?10:49??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\Web.config
?????文件????????114??2011-07-28?22:33??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\使用說(shuō)明.txt
?????文件???????2063??2011-07-24?18:00??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\數(shù)據(jù)庫(kù)表.sql
?????目錄??????????0??2014-04-26?08:23??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\App_Code\Bll
?????目錄??????????0??2014-04-26?08:23??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\App_Code\Dal
?????目錄??????????0??2014-04-26?08:23??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\App_Code\IDal
?????目錄??????????0??2014-04-26?08:23??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\App_Code\Model
?????目錄??????????0??2014-04-26?08:23??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓\App_Code
?????目錄??????????0??2014-04-26?08:36??Ajax+遞歸實(shí)現(xiàn)評(píng)論蓋樓
-----------?---------??----------?-----??----
????????????????73258????????????????????20
評(píng)論
共有 條評(píng)論
相關(guān)資源
- Asp.net學(xué)生信息管理系統(tǒng)源碼
- asp.net C#購(gòu)物車(chē)源代碼
- ASP.NET實(shí)驗(yàn)室預(yù)約管理系統(tǒng)
- 020ASP.NET車(chē)輛綜合管理系統(tǒng).zip
- c# 高校檔案信息管理系統(tǒng)
- asp.net中c#做的躲避小游戲,希望大家
- ASP.NET C# 工資管理系統(tǒng)
- ASP.NET客戶(hù)管理系統(tǒng)(畢業(yè)設(shè)計(jì) C#
- 在線求職系統(tǒng)(C#ASP.NET源碼)
- asp.net 在線考試系統(tǒng)及論文
- ASP.Net文件上傳管理源碼
- 《OA企業(yè)辦公自動(dòng)化》asp.net 源碼(附
- asp.netc#開(kāi)發(fā)規(guī)范
- asp.net 大文件上傳(帶進(jìn)度條)
- 通過(guò)程序自動(dòng)填充并提交ASP.NET表單(
- ASP.NET 基礎(chǔ)編程文檔(PPT電子教案)
-
ASP.NET_xm
l深入編程技術(shù) - asp.net 新聞發(fā)布系統(tǒng)源碼(附文檔以及
- asp.net 簡(jiǎn)單的Ajax應(yīng)用
- asp.net 企業(yè)官網(wǎng)源碼(附數(shù)據(jù)庫(kù))
- asp.net 花語(yǔ)花店銷(xiāo)售網(wǎng)站源碼(含數(shù)據(jù)
- ASP.NET資產(chǎn)管理系統(tǒng)源碼(附數(shù)據(jù)庫(kù))
- ajax 登錄(基于asp.net)
- asp.net 簡(jiǎn)單新聞發(fā)布系統(tǒng)源碼(附數(shù)據(jù)
- asp.net新聞發(fā)布系統(tǒng)(源碼+數(shù)據(jù)庫(kù)+論
- asp.net網(wǎng)上購(gòu)物系統(tǒng)源碼
- ASP.NET 在瀏覽器中預(yù)覽文件
- asp.net 生命周期
- asp.net 花語(yǔ)花店銷(xiāo)售網(wǎng)站源碼(附數(shù)據(jù)
- asp.net 購(gòu)物車(chē)實(shí)現(xiàn)(基于Session)