您的位置:首页 > 其它

.net新闻内容分页

2008-07-08 13:57 225 查看
项目中遇到带图片,可能还有视频,flash的新闻内容显示,内容过长需要分页,网上搜了搜。这里我使用RadEditor编辑器手动控制分页符。

<radE:RadEditor ID="RadEditor1" runat="server">
</radE:RadEditor>
<script type="text/javascript" language="javascript" src="http://www.cnblogs.com/librarys/radEditorCustom.js"></script>

在ToolFile.Xml中添加

<tools name="AllowPage">
<tool name="Custom"></tool>
</tools>
[radEditorCustom.js]

// JScript 文件

RadEditorCommandList["Custom"] = function(commandName, editor, oTool)
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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.Text;
using System.Text.RegularExpressions;

public class AllowPager:System.Web.UI.Page

调用:

public void init_Data()
string nID = Get_nID();
int nKey = Get_nKey();
GS.Comm.List cl = new GS.Comm.List(nKey,nID);
lbTitle.Text = cl.sTitle;
lbAuthor.Text = "编辑:"+(cl.sAuthor==""?"ArtJie":cl.sAuthor);
lbDateTime.Text = "时间:"+cl.dPubDate.ToString();
lbNum.Text = "点击数:" + cl.nNum.ToString();
string content=cl.sText;
lbContent.Text = AllowPager.NewsContentPager(content, "news_show.aspx?nKey=" + nKey + "&nID=" + nID, Get_Page);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: