Use FCKeditor pagination in Asp.net

Source: Internet
Author: User

Because the website needs to use FCKeditor to paging Long News and find it on the Internet, the solution is not clear and scattered, so you can change it yourself

First, modify the two JS files in FCKeditor \ editor \ JS \, fckeditorcode_gecko.js and fckeditorcode_ie.js.

1. Find <span style = "display: none"> & nbsp; </span> and change it to $ [Page] $

2. Remove E. style. pagebreakafter = 'alway)

The above modification is the content of the FCKeditor insert paging character, so that it can be replaced in the paging method.

The following is the paging method.

/// <Summary> /// document paging function /// </Summary> /// <Param name = "content"> document content </param> /// <param name = "currentpage"> current page number </param> // <Param name = "pageurl"> current page address </param> protected void articlepage (string content, int currentpage, string pageurl) {int pagecount = 0; // page content = content. replace ("<div> $ [Page] $/div>", "[-- page --]"); string [] tempcontent = system. text. regularexpressions. regEx. split (content, "\ U005b -- page --]"); // get the pagination character "\ u005b" is the escape pagecount = tempcontent. length; string outputcontent = ""; // the content to be output if (pagecount <= 1) {outputcontent = content; // The content of this article. pnlpage. visible = false;} else {string pagestr = ""; // pagestr + = "Total <span style = 'font-weight: bold '> "+ pagecount +" </span> page "; if (currentpage! = 1) {pagestr + = "<a class = 'prev' href =" + pageurl + "& page =" + (currentpage-1) + "> previous page </a>" ;}for (INT I = 1; I <= pagecount; I ++) {if (I = currentpage) pagestr + = ("<SPAN class = 'active'>" + I + "</span> "); else pagestr + = ("<a class = 'num' href =" + pageurl + "& page =" + I + "> [" + I + "] </a> ");} if (currentpage! = Pagecount) {pagestr + = "<a class = 'Next' href =" + pageurl + "& page =" + (currentpage + 1) + "> next page </a>";} This. lbl_page.text = pagestr; // page number outputcontent = tempcontent [currentpage-1]. tostring ();} This. literal1.text = outputcontent; // display the content of the article} // This paging method is obtained on the network.

This FCKeditor paging method is a bit rigid. I don't know if you have a better method. Please advise !!!

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.