I've got a website built with BlogEngine that consists of mostly pages, not posts. I'm trying to modify the
PageList.cs file to set a different style for a link if that link represents the current page. No matter what I do to get the URL or Title of the current page, I get that of some arbitrary page. Here's what
I've got, within the foreach loop in BindPages():
. . .
System.Web.UI.Page pg = (System.Web.UI.Page)HttpContext.Current.CurrentHandler;
string title = pg.Title;
if (title == page.Title)
. . .
I've tried using "HttpContext.Current.Request.Url" and every other standard way of getting the URL as well. What is displayed in the address bar is the correct URL for the page; what is assigned to the title variable is the URL for one of
the pages -- seems to be arbitrary, cause it changes whenever I make a change to PageList.cs and refresh.
The PageList control is being displayed in site.master, and I've even tried putting it in
Page.aspx. This is definitely strange behavior, and seems like a bug.