Construction Method of URL rewrite in the pagination part of the Post displayed on the communtiy server Forum

Source: Internet
Author: User

You may find the list of Forum posts on the communtiy Server

Like http://communityserver.org/forums/129/ShowForum.aspx

The connection address at the following page is similar to showforum. aspx? Pageindex = 2
Searchfriendly is not implemented. Let's modify it a bit.CodeYou can implement an address similar to that on the post display page.
Add in siteurl. config first

< URL Name = "Forum_paged" Location = "Forums" Path = "{0}/{1}/showforum. aspx" Pattern = "(\ D +)/showforum. aspx" Vanity = "Showforum. aspx? Pageindex = $1 ^ forumid = $2"   />

Add in siteurl. CS
 

Public Virtual string formpagedformat (INT forumid)
{
Return urldata. formaturl ("forum_paged", "{0}", forumid. tostring (), forumid. tostring ());
}

Add pager. urlpattern = siteurls. instance (). formpagedformat (cscontext. forumid) To The paer data binding area in threadview. CS );

Re-compile. OK. Check the effect ~~

Http://www.3pub.com/bbs/3/default.aspx

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.