Using a page control to filter news/articles - get parent page url
Hello. I wanted to implement the paging option on the news archive on my site, but when the archiver link is clicked for a specific month/year, the url passed picks up the current page "page" param in error.
e.g.
i have browsed to page 8 of news:
http://localhost:22744/articles2?page=8
when i click on the SF archive control it takes me to:
http://localhost:22744/articles2?page=8&year=2012&month=04
there is no page 8 for the records returned for year2012, month 04...so a 404 page occurs. I raised a ticket and was told i needed build my own custom control to manage paging from archive control...
So that is what i am trying to do, and i am nearly there, except i cannot build the URL properly for the hyperlinks in my archivelist.
I have used a custom control to linq-to-object on
using (NewsManager nMan = NewsManager.GetManager())
string[] myUrl = this.Parent.Page.Request.Url.ToString().Split('?');<
br
> NewurlStr = myUrl[0];
myHref.NavigateUrl = string.Format("0?page=1&year=1&month=2", NewurlStr, myYM.yearMonth.Year, myYM.yearMonth.Month);<
br
> myHref.Text = myYM.yearMonth.ToString("MMMM yyyy");<
br
>
Hi,
Get the current page that is currently requested in the browser trough SiteMapBase that has all the page nodes and resolved the one you currently browse.
using
Telerik.Sitefinity.Web;
var actualSitemapNode = SiteMapBase.GetActualCurrentNode()